diff options
938 files changed, 5662 insertions, 38434 deletions
diff --git a/ChangeLog b/ChangeLog index eb90718080..509579ea37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,709 @@ +2006-03-01 Kaz Kojima <kkojima@rr.iij4u.or.jp> + + * sysdeps/unix/sysv/linux/sh/pread.c: Copy in mips pread.c. + * sysdeps/unix/sysv/linux/sh/pwrite.c: Copy in mips pwrite.c. + * sysdeps/unix/sysv/linux/sh/pread64.c: Copy in mips pread64.c. + * sysdeps/unix/sysv/linux/sh/pwrite64.c: Copy in mips pwrite64.c. + +2006-02-28 Roland McGrath <roland@redhat.com> + + * elf/tst-tls-dlinfo.c: New file. + * elf/Makefile (tests): Add it. + ($(objpfx)tst-tls-dlinfo): Depend on $(libdl). + ($(objpfx)tst-tls-dlinfo.out): Depend on $(objpfx)tst-tlsmod2.so. + + * dlfcn/dlfcn.h (RTLD_DI_PROFILENAME, RTLD_DI_PROFILEOUT): New enum + values, reserve unsupported requested names used on Solaris. + (RTLD_DI_TLS_MODID, RTLD_DI_TLS_DATA): New enum values. + (RTLD_DI_MAX): Likewise. + * dlfcn/dlinfo.c (dlinfo_doit): Handle RTLD_DI_TLS_MODID and + RTLD_DI_TLS_DATA. + + * elf/dl-tls.c (_dl_tls_get_addr_soft): New function. + * sysdeps/generic/ldsodefs.h: Declare it. + * elf/Versions (ld: GLIBC_PRIVATE): Add it. + * elf/link.h (struct dl_phdr_info): New members dlpi_tls_modid, + dlpi_tls_data. + * elf/dl-iteratephdr.c (__dl_iterate_phdr): Fill them in. + + * include/link.h: Don't copy contents from elf/link.h. + Instead, #include it while #define'ing around link_map. + * elf/dl-debug.c (_dl_debug_initialize): Add a cast. + Add bogus extern decl to verify link_map members. + * elf/loadtest.c (MAPS): New macro, cast _r_debug._r_map. + (OUT, main): Use it in place of _r_debug._r_map. + * elf/unload.c: Likewise. + * elf/unload2.c: Likewise. + * elf/neededtest.c (check_loaded_objects): Likewise. + * elf/neededtest2.c (check_loaded_objects): Likewise. + * elf/neededtest3.c (check_loaded_objects): Likewise. + * elf/neededtest4.c (check_loaded_objects): Likewise. + * elf/circleload1.c (check_loaded_objects): Likewise. + + * nscd/nscd_helper.c: Include <time.h> for `time' declaration. + + * include/fcntl.h: Declare __openat, __open64. Use libc_hidden_proto. + * io/openat.c (__openat): Define instead of openat. + Use libc_hidden_def. Define openat with weak_alias. + * io/openat64.c (__openat64): Define instead of openat64. + Use libc_hidden_def. Define openat64 with weak_alias. + * sysdeps/unix/sysv/linux/openat.c: Likewise. + + * libio/genops.c: Include <sched.h> for __sched_yield decl. + + * Makeconfig (+includes): Add back $(includes) + after $(+sysdep-includes). + + * Makerules ($(common-objpfx)%.make): Use -DASSEMBLER. + +2006-02-28 Jakub Jelinek <jakub@redhat.com> + + * posix/sys/types.h [!__GNUC_PREREQ (2, 7)] (int64_t, u_int64_t): + typedef to long int resp. unsigned long int on 64-bit arches. + + * sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c: Include x86_64 + umount.c rather than hppa umount.c. + * sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: Include sh chown.c + rather than m68k chown.c. + * sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Include sh + fchownat.c rather than m68k fchownat.c. + * sysdeps/unix/sysv/linux/sh/chown.c: Copy over from m68k chown.c. + * sysdeps/unix/sysv/linux/sh/fchownat.c: Copy over from m68k + fchownat.c. + * sysdeps/unix/sysv/linux/x86_64/brk.c: Copy over from hppa brk.c. + * sysdeps/unix/sysv/linux/x86_64/umount.c: Copy over from hppa + umount.c. + +2006-02-28 Roland McGrath <roland@redhat.com> + + * sysdeps/hppa: Directory removed, saved in ports repository. + * sysdeps/mach/hppa: Likewise. + * sysdeps/mach/hurd/hppa: Likewise. + * sysdeps/unix/sysv/linux/hppa: Likewise. + * configure.in (machine): Remove hppa* cases. + * configure: Regenerated. + * shlib-versions: Remove hppa cases. + + * sysdeps/m68k: Directory removed, saved in ports repository. + * sysdeps/unix/bsd/m68k: Likewise. + * sysdeps/unix/sysv/linux/m68k: Likewise. + * configure.in (machine): Remove m68* cases. + * configure: Regenerated. + + * elf/rtld-Rules (subdir-args): New variable. + (rtld-subdir-make): Use it. + +2006-02-22 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h + (DO_CALL): Add support for 6 system call parameters. + (DECLARGS_6, ASMFMT_6): Define. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. + +2006-02-28 Roland McGrath <roland@redhat.com> + + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Copy in i386/bits/fcntl.h. + +2006-02-27 Roland McGrath <roland@redhat.com> + + * scripts/config.guess: Update from master, timestamp='2006-02-27'. + * scripts/config.sub: Update from master, timestamp='2006-02-27'. + + * Makefile (subdir-target-args): New variable. + ($(all-subdirs-targets)): Use it in place of -C option. + * Rules: Use $(..) instead of ../ if it's already defined. + * Makeconfig (subdir-srcdirs): New variable. + * csu/Makefile (all-Banner-files): Use it. + + * configure.in (--enable-add-ons): Set to "yes" by default. + Handle absolute add-on directory names when looking for configure + fragments. Also look for sysdeps/*/preconfigure fragments in add-ons. + Require add-on configure to set $libc_add_on_canonical, use + that in $add_ons_sfx. Substitute add_on_subdirs with computed list + of subdir names each add-on configure set in libc_add_on_subdirs. + * configure: Regenerated. + * Makefile (%/preconfigure: %/preconfigure.in): New pattern rule. + * config.make.in (add-on-subdirs): New substituted variable. + * Makeconfig (all-subdirs): Include $(add-on-subdirs). + Remove $(add-ons), $(sysdep-subdirs). + Don't filter out $(sysdep-inhibit-subdirs). + ($(common-objpfx)sysd-dirs): Target removed. Don't include it. + ($(common-objpfx)sysd-sorted): Rewritten to feed Depend and Subdirs + files together to gen-sorted.awk, and $(subdirs) via -v. + (subdirs): Remove magic reordering for mach and hurd. + * scripts/gen-sorted.awk: Use subdirs from command line. + Process Subdirs and Depend files directly. + Let Subdirs files use "first dir" and "inhibit dir". + Always move elf to the end of the list. + * hurd/Depend: New file. + * sysdeps/mach/Subdirs: Use "first mach". + + * Makefile (dist-separate): Remove linuxthreads. + (dist-separate-linuxthreads): Variable removed. + (glibc-%.tar rule): Use $(sysdeps-add-ons). + + * Makerules ($(common-objpfx)Versions.v.i): Use $(subdirs), + not $(all-subdirs). + (sysdep-makefiles): Use $(sysdirs). + (sysdirs): Remove export. + ($(+sysdir_pfx)sysd-rules): Handle absolute directory names in + $(config-sysdirs). + (+sysdir_pfx): Variable removed. + (sysd-rules): Use $(common-objpfx) in place of it. + (sysdirs): Variable moved to ... + * Makeconfig (sysdirs): ... here. + Handle absolute directory names in $(config-sysdirs). + (full_config_sysdirs): Variable removed. + * csu/Makefile: Use $(sysdirs) in vpath directive. + * math/Makefile (ulps-file): Use $(sysdirs). + * sysdeps/gnu/Makefile (errlist-c): Likewise. + ($(objpfx)errlist-compat.c): Likewise. + * Makeconfig (all-Subdirs-files): Likewise. + ($(common-objpfx)config.status): Likewise. + + * configure.in (sysnames): Handle absolute add-on directory names. + (sysdeps_add_ons): New variable, AC_SUBST it. + Compute which add-ons contributed sysdeps directories. + * configure: Regenerated. + * config.make.in (sysdeps-add-ons): New substituted variable. + * Makerules (+sysdep_dirs, +sysdep-includes): Variables moved ... + * Makeconfig: ... to here. + (+sysdep_dirs): Append $(sysdeps-add-ons) here. + (+includes): Remove $(objpfx) include, already in $(+sysdep_dirs). + Remove $(includes). + (sysdep-makeconfigs): Use $(+sysdep_dirs). + ($(common-objpfx)shlib-versions.v.i): Likewise. + + * Makeconfig: Remove hair to set Makeconfig-add-on. + + * sysdeps/unix/Makefile (sysdirs): Remove export. + (asm_CPP): Variable removed. + ($(common-objpfx)sysd-syscalls): Pass them directly for the script. + + * sysdeps/posix/Makefile: New file. + * Makerules (L_tmpnam, TMP_MAX, L_ctermid, L_cuserid): Set non-posix + values here with ?=. + + * stdlib/gen-mpn-copy: File removed. + * stdlib/Makefile (distribute): Remove it. + * configure.in: Don't grok --with-gmp. + * configure: Regenerated. + + * configure.in (libc_cv_idn): Don't check it; libidn/configure does it. + * configure: Regenerated. + +2006-02-27 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/linkat.c (linkat): Allow flags to be set + when syscall is used. + * io/fcntl.h (AT_SYMLINK_FOLLOW): Define. + +2006-02-26 Roland McGrath <roland@redhat.com> + + * bare: Directory removed, saved in ports repository. + + * sysdeps/unix/common/Makefile: File removed. + * sysdeps/unix/common/glue-ctype.c: File removed. + * sysdeps/unix/common/configure.in: File removed. + * sysdeps/unix/common/configure: File removed. + + * sysdeps/unix/configure.in: File removed. + * sysdeps/unix/configure: File removed. + * sysdeps/unix/make_errlist.c: File removed. + * sysdeps/unix/Makefile ($(objpfx)errlist.c, $(objpfx)make_errlist): + Rules removed. + + * timezone/africa: Update from tzdata2006b (comment changes only). + * timezone/antarctica: Likewise. + * timezone/asia: Likewise. + * timezone/australasia: Likewise. + * timezone/backward: Likewise. + * timezone/etcetera: Likewise. + * timezone/europe: Likewise. + * timezone/factory: Likewise. + * timezone/iso3166.tab: Likewise. + * timezone/leapseconds: Likewise. + * timezone/northamerica: Likewise. + * timezone/pacificnew: Likewise. + * timezone/solar87: Likewise. + * timezone/solar88: Likewise. + * timezone/solar89: Likewise. + * timezone/southamerica: Likewise. + * timezone/systemv: Likewise. + * timezone/zone.tab: Likewise. + +2006-02-26 Ulrich Drepper <drepper@redhat.com> + + * posix/unistd.h: Add fifth parameter to linkat. + * io/linkat.c: Likewise. + * sysdeps/unix/sysv/linux/linkat.c: Likewise. + * io/tst-linkat.c (do_test): Pass new parameter to linkat. + + * elf/do-lookup.h (do_lookup_x): No need to compare SKIP to NULL + before comparison with MAP. + + * elf/dl-sym.c (do_sym): For RTLD_NEXT, pass MATCH to + dl_lookup_symbol_x instead of L. + +2006-02-24 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/gnu/net/if.h (IFF_DYNAMIC): New macro. + +2006-02-24 David S. Miller <davem@sunset.davemloft.net> + + * configure.in: Use sparc/sparc32/sparcv9/sparcv9b in place + of sparc/sparc32/sparcv9b. + * sysdeps/sparc/sparc32/sparcv9b/Implies: File removed. + * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9b/Implies: File removed. + +2006-02-24 Roland McGrath <roland@redhat.com> + + * elf/elf.h (HWCAP_SPARC_BLKINIT): New macro. + * sysdeps/sparc/dl-procinfo.h (HWCAP_IMPORTANT): Add it. + (_DL_HWCAP_COUNT): Increase to 7. + * sysdeps/sparc/dl-procinfo.c (_dl_sparc_cap_flags): Add "v9v". + From David S. Miller <davem@sunset.davemloft.net>. + + * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c: Moved to ... + * sysdeps/sparc/dl-procinfo.c: ... here, new file. + * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h: Moved to ... + * sysdeps/sparc/dl-procinfo.h: ... here, new file. + (HWCAP_IMPORTANT): Include HWCAP_SPARC_V9 when [__WORDSIZE != 64]. + * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c: File removed. + * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h: File removed. + + * elf/sofini.c (__FRAME_END__): Mark as const. + * elf/soinit.c (__EH_FRAME_BEGIN__): Likewise. Add used attribute. + +2006-02-18 Joseph S. Myers <joseph@codesourcery.com> + + * soft-fp/single.h (SFtype): Define. + (union _FP_UNION_S): Use it. + * soft-fp/double.h (DFtype): Define. + (union _FP_UNION_D): Use it. + * soft-fp/extended.h (XFtype): Define. + (union _FP_UNION_E): Use it. + * soft-fp/quad.h (TFtype): Define. + (union _FP_UNION_Q): Use it. + * soft-fp/soft-fp.h: Add _LIBC conditionals. + (SI_BITS, DI_BITS): Define. + * soft-fp/op-common.h (_FP_DECL): Add __attribute__((unused)) for + X##_c. + (_FP_CMP_EQ): Use parentheses for && inside ||. + (_FP_TO_INT): Use statement expressions in conditional controlling + constant shift. + (_FP_FROM_INT): Likewise. Take unsigned type as argument. + * soft-fp/op-2.h (_FP_FRAC_SLL_2, _FP_FRAC_SRL_2, _FP_FRAC_SRST_2, + _FP_FRAC_SRS_2, _FP_FRAC_ASSEMBLE_2): Use statement expressions in + conditional controlling possibly constant shift. + (_FP_FRAC_SRST_2, _FP_FRAC_SRS_2): Avoid left shift by exactly + _FP_W_TYPE_SIZE. + (_FP_FRAC_GT_2, _FP_FRAC_GE_2): Use parentheses for && inside ||. + * soft-fp/op-4.h (_FP_FRAC_SRST_4): Avoid left shift by exactly + _FP_W_TYPE_SIZE. + (__FP_FRAC_ADD_3, __FP_FRAC_ADD_4, __FP_FRAC_SUB_3, + __FP_FRAC_SUB_4): Use _FP_W_TYPE for carry flags. + * soft-fp/op-8.h (_FP_FRAC_SRS_8): Avoid left shift by exactly + _FP_W_TYPE_SIZE. + * soft-fp/floatdidf.c: Pass unsigned type and macro for type size. + * soft-fp/floatdisf.c: Likewise. + * soft-fp/floatditf.c: Likewise. + * soft-fp/floatsidf.c: Likewise. + * soft-fp/floatsisf.c: Likewise. + * soft-fp/floatsitf.c: Likewise. + * soft-fp/floatundidf.c: Likewise. + * soft-fp/floatundisf.c: Likewise. + * soft-fp/floatunditf.c: Likewise. + * soft-fp/floatunsidf.c: Likewise. + * soft-fp/floatunsisf.c: Likewise. + * soft-fp/floatunsitf.c: Likewise. + * soft-fp/fixdfdi.c: Pass macro for type size. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * soft-fp/fixunsdfdi.c: Likewise. + * soft-fp/fixunsdfsi.c: Likewise. + * soft-fp/fixunssfdi.c: Likewise. + * soft-fp/fixunssfsi.c: Likewise. + * soft-fp/fixunstfdi.c: Likewise. + * soft-fp/fixunstfsi.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtqux.c: Pass unsigned type. + * sysdeps/alpha/soft-fp/ots_cvtqx.c: Likewise. + * sysdeps/powerpc/soft-fp/q_itoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_lltoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_ulltoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_utoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_itoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c: Likewise. + * soft-fp/adddf3.c: Use typedefs for argument and return types. + * soft-fp/addsf3.c: Likewise. + * soft-fp/addtf3.c: Likewise. + * soft-fp/divdf3.c: Likewise. + * soft-fp/divsf3.c: Likewise. + * soft-fp/divtf3.c: Likewise. + * soft-fp/eqdf2.c: Likewise. + * soft-fp/eqsf2.c: Likewise. + * soft-fp/eqtf2.c: Likewise. + * soft-fp/extenddftf2.c: Likewise. + * soft-fp/extendsfdf2.c: Likewise. + * soft-fp/extendsftf2.c: Likewise. + * soft-fp/fixdfdi.c: Likewise. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * soft-fp/fixunsdfdi.c: Likewise. + * soft-fp/fixunsdfsi.c: Likewise. + * soft-fp/fixunssfdi.c: Likewise. + * soft-fp/fixunssfsi.c: Likewise. + * soft-fp/fixunstfdi.c: Likewise. + * soft-fp/fixunstfsi.c: Likewise. + * soft-fp/floatdidf.c: Likewise. + * soft-fp/floatdisf.c: Likewise. + * soft-fp/floatditf.c: Likewise. + * soft-fp/floatsidf.c: Likewise. + * soft-fp/floatsisf.c: Likewise. + * soft-fp/floatsitf.c: Likewise. + * soft-fp/floatundidf.c: Likewise. + * soft-fp/floatundisf.c: Likewise. + * soft-fp/floatunditf.c: Likewise. + * soft-fp/floatunsidf.c: Likewise. + * soft-fp/floatunsisf.c: Likewise. + * soft-fp/floatunsitf.c: Likewise. + * soft-fp/gedf2.c: Likewise. + * soft-fp/gesf2.c: Likewise. + * soft-fp/getf2.c: Likewise. + * soft-fp/ledf2.c: Likewise. + * soft-fp/lesf2.c: Likewise. + * soft-fp/letf2.c: Likewise. + * soft-fp/muldf3.c: Likewise. + * soft-fp/mulsf3.c: Likewise. + * soft-fp/multf3.c: Likewise. + * soft-fp/negdf2.c: Likewise. + * soft-fp/negsf2.c: Likewise. + * soft-fp/negtf2.c: Likewise. + * soft-fp/sqrtdf2.c: Likewise. + * soft-fp/sqrtsf2.c: Likewise. + * soft-fp/sqrttf2.c: Likewise. + * soft-fp/subdf3.c: Likewise. + * soft-fp/subsf3.c: Likewise. + * soft-fp/subtf3.c: Likewise. + * soft-fp/truncdfsf2.c: Likewise. + * soft-fp/trunctfdf2.c: Likewise. + * soft-fp/trunctfsf2.c: Likewise. + * soft-fp/unorddf2.c: Likewise. + * soft-fp/unordsf2.c: Likewise. + * soft-fp/unordtf2.c: Likewise. + +2006-02-09 Joseph S. Myers <joseph@codesourcery.com> + + * soft-fp/op-common.h (_FP_UNPACK_SEMIRAW): Define. + (_FP_OVERFLOW_SEMIRAW): Likewise. + (_FP_CHECK_SIGNAN_SEMIRAW): Likewise. + (_FP_CHOOSENAN_SEMIRAW): Likewise. + (_FP_EXP_NORMAL): Likewise. + (_FP_PACK_SEMIRAW): Likewise. + (_FP_ADD_INTERNAL): Rewrite to operate on semi-raw value. + (_FP_SUB): Likewise. + (_FP_TO_INT): Rewrite to operate on raw values. Don't set INVALID + exception for conversions where most negative representable + integer is correct truncated value, but do set INEXACT for such + conversions where appropriate. Don't always left-shift for + converting to a wider integer. + (_FP_FROM_INT): Rewrite to yield raw value. Correct shift for + integers with one more bits than (mantissa + guard) bits for the + floating point format. Don't use __FP_FRAC_SRS_1 for shifting + integers that may be wider than _FP_W_TYPE_SIZE. + (FP_CONV): Don't define. + (FP_EXTEND): Define. + (FP_TRUNC): Likewise. + * soft-fp/op-1.h (_FP_FRAC_SRST_1, __FP_FRAC_SRST_1): Define. + (_FP_FRAC_CONV_1_1): Don't define. + (_FP_FRAC_COPY_1_1): Define. + * soft-fp/op-2.h (_FP_FRAC_SRST_2): Define. + (_FP_FRAC_CONV_1_2, _FP_FRAC_CONV_2_1): Don't define. + (_FP_FRAC_COPY_1_2, _FP_FRAC_COPY_2_1): Define. + * soft-fp/op-4.h (_FP_FRAC_SRST_4): Define. + (_FP_FRAC_SRS_4): Define based on _FP_FRAC_SRST_4. + (_FP_FRAC_CONV_1_4, _FP_FRAC_CONV_2_4): Don't define. + (_FP_FRAC_COPY_1_4, _FP_FRAC_COPY_2_4): Define. + (_FP_FRAC_CONV_4_1, _FP_FRAC_CONV_4_2): Don't define. + (_FP_FRAC_COPY_4_1, _FP_FRAC_COPY_4_2): Define. + * soft-fp/single.h (_FP_FRACTBITS_S): Define. + (_FP_FRACXBITS_S): Define in terms of _FP_FRACXBITS_S. + (_FP_WFRACXBITS_S): Likewise. + (_FP_QNANBIT_SH_S, _FP_IMPLBIT_SH_S): Define. + (FP_UNPACK_SEMIRAW_S, FP_UNPACK_SEMIRAW_SP): Define. + (FP_PACK_SEMIRAW_S, FP_PACK_SEMIRAW_SP): Define. + * soft-fp/double.h (_FP_QNANBIT_SH_D, _FP_IMPLBIT_SH_D): Define. + (FP_UNPACK_SEMIRAW_D, FP_UNPACK_SEMIRAW_D): Define + (FP_PACK_SEMIRAW_D, FP_PACK_SEMIRAW_DP): Define. + * soft-fp/extended.h (_FP_QNANBIT_SH_E, _FP_IMPLBIT_SH_E): Define. + (FP_UNPACK_EP): Correct typo. + (FP_UNPACK_SEMIRAW_E, FP_UNPACK_SEMIRAW_EP): Define. + (FP_PACK_SEMIRAW_E, FP_PACK_SEMIRAW_EP): Define. + * soft-fp/quad.h (_FP_QNANBIT_SH_Q, _FP_IMPLBIT_SH_Q): Define. + (FP_UNPACK_SEMIRAW_Q, FP_UNPACK_SEMIRAW_QP): Define. + (FP_PACK_SEMIRAW_Q, FP_PACK_SEMIRAW_QP): Define. + * soft-fp/fixdfdi.c: Use unsigned type for result of conversion. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtxq.c: Likewise. + * sysdeps/alpha/soft-fp/ots_nintxq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtoi.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtoll.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtoi.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtoll.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtox.c: Likewise. + * soft-fp/adddf3.c: Update for changed soft-fp interfaces. + * soft-fp/addsf3.c: Likewise. + * soft-fp/addtf3.c: Likewise. + * soft-fp/extenddftf2.c: Likewise. + * soft-fp/extendsfdf2.c: Likewise. + * soft-fp/extendsftf2.c: Likewise. + * soft-fp/fixdfdi.c: Likewise. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * soft-fp/fixunsdfdi.c: Likewise. + * soft-fp/fixunsdfsi.c: Likewise. + * soft-fp/fixunssfdi.c: Likewise. + * soft-fp/fixunssfsi.c: Likewise. + * soft-fp/fixunstfdi.c: Likewise. + * soft-fp/fixunstfsi.c: Likewise. + * soft-fp/floatdidf.c: Likewise. + * soft-fp/floatdisf.c: Likewise. + * soft-fp/floatditf.c: Likewise. + * soft-fp/floatsidf.c: Likewise. + * soft-fp/floatsisf.c: Likewise. + * soft-fp/floatsitf.c: Likewise. + * soft-fp/floatundidf.c: Likewise. + * soft-fp/floatundisf.c: Likewise. + * soft-fp/floatunditf.c: Likewise. + * soft-fp/floatunsidf.c: Likewise. + * soft-fp/floatunsisf.c: Likewise. + * soft-fp/floatunsitf.c: Likewise. + * soft-fp/subdf3.c: Likewise. + * soft-fp/subsf3.c: Likewise. + * soft-fp/subtf3.c: Likewise. + * soft-fp/truncdfsf2.c: Likewise. + * soft-fp/trunctfdf2.c: Likewise. + * soft-fp/trunctfsf2.c: Likewise. + * sysdeps/alpha/soft-fp/ots_add.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtqux.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtqx.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvttx.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtxq.c: Likewise. + * sysdeps/alpha/soft-fp/ots_cvtxt.c: Likewise. + * sysdeps/alpha/soft-fp/ots_nintxq.c: Likewise. + * sysdeps/alpha/soft-fp/ots_sub.c: Likewise. + * sysdeps/powerpc/soft-fp/q_add.c: Likewise. + * sysdeps/powerpc/soft-fp/q_dtoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_itoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_lltoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtod.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtoi.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtoll.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtos.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtou.c: Likewise. + * sysdeps/powerpc/soft-fp/q_qtoull.c: Likewise. + * sysdeps/powerpc/soft-fp/q_stoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_sub.c: Likewise. + * sysdeps/powerpc/soft-fp/q_ulltoq.c: Likewise. + * sysdeps/powerpc/soft-fp/q_utoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_add.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_dtoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtod.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtoi.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtoll.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtos.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtou.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_qtoull.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_stoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_sub.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Likewise. + * sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_add.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_itoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtod.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtos.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_qtox.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_stoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_sub.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c: Likewise. + * sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c: Likewise. + +2006-02-23 Roland McGrath <roland@redhat.com> + + * include/libc-symbols.h: Fix comment typo. + From Peter Kjellerstedt <peter.kjellerstedt@axis.com>. + + * sysdeps/unix/sysv/linux/i386/fchownat.c: Diddle code so that "fail" + label is always used. + + [BZ #2172] + * bits/syslog-path.h: New file. + * misc/Makefile (headers): Add it. + * misc/sys/syslog.h: Include it. + (_PATH_LOG): Macro removed. + From Robert Millan <robertmh@gnu.org>. + + * sysdeps/unix/sysv/linux/ftruncate64.c: Find generic implementation + in misc/, not posix/. + Reported by David S. Miller <davem@davemloft.net>. + +2006-02-23 Jakub Jelinek <jakub@redhat.com> + + * posix/sched_yield.c (__sched_yield): Add libc_hidden_def. + * sysdeps/mach/sched_yield.c (__sched_yield): Likewise. + +2006-02-22 Roland McGrath <roland@redhat.com> + + * po/libc.pot: Regenerated. + +2006-02-22 Jakub Jelinek <jakub@redhat.com> + + * nis/ypclnt.c (yperr_string, ypbinderr_string): Add N_() + around string literals. + +2005-10-03 Jakub Jelinek <jakub@redhat.com> + + * nscd/selinux.c (audit_init): Print error string in the failure + message. + +2006-02-21 Roland McGrath <roland@redhat.com> + + * sysdeps/unix/sysv/linux/kernel-features.h + (__ASSUME_CLONE_THREAD_FLAGS): Consolidate definitions. + + * sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Update comment, remove + __THROW from epoll_wait, to match .../linux/sys/epoll.h file. + +2006-02-03 Jakub Jelinek <jakub@redhat.com> + + * manual/filesys.texi (futimes): Fix prototype. + +2004-08-09 Paul Eggert <eggert@cs.ucla.edu> + + [BZ #315] + * manual/memory.texi (Obstacks Data Alignment): The default + alignment is not 4: it is enough to hold any type of data. + Problem reported by Benno in + <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>. + +2005-11-15 Robert Millan <robertmh@gnu.org> + + [BZ #2161] + * manual/llio.texi (read, write): Document EINVAL on unaligned access. + +2006-02-21 Roland McGrath <roland@redhat.com> + + * sysdeps/i386/i686/memset.S: Fix treatment of unaligned pointer. + Reported by John Zulauf <john.zulauf@amd.com>. + +2004-11-23 Richard Sandiford <rsandifo@redhat.com> + + * configure.in (libc_cv_gcc_dwarf2_unwind_info): Delete. + (HAVE_DWARF2_UNWIND_INFO{,_STATIC}): Remove AC_DEFINEs. + * configure: Regenerate. + * config.h.in (HAVE_DWARF2_UNWIND_INFO{,_STATIC}): Remove undefs. + * elf/soinit.c: Don't include gccframe.h. + (__EH_FRAME_BEGIN__): Define unconditionally. + (__register_frame_info, __deregister_frame_info) + (__register_frame_info_bases, __deregister_frame_info_bases) + (__register_frame, __deregister_frame): Remove declarations. + (__libc_global_ctors, __libc_fini): Don't call registry functions. + * elf/sofini.c (__EH_FRAME_END__): Define unconditionally. + +2006-01-18 Samuel Thibault <samuel.thibault@ens-lyon.org> + + [BZ #2178] + * sysdeps/mach/hurd/getsid.c (getsid): When parameter PID is zero, + use _hurd_pid instead. + +2006-02-20 Richard Henderson <rth@redhat.com> + + * sysdeps/alpha/soft-fp/Makefile (CPPFLAGS): Add soft-fp include + to math subdir. + * sysdeps/alpha/soft-fp/e_sqrtl.c: Don't use local-soft-fp.h. + (__ieee754_sqrtl): Add _round local variable. + * sysdeps/unix/sysv/linux/alpha/fpu/Implies: Remove. + + * sysdeps/unix/sysv/linux/alpha/fxstatat.c: Fix hidden defs. + +2006-02-20 Roland McGrath <roland@redhat.com> + + * sysdeps/mips: Directory removed, saved in ports repository. + * sysdeps/unix/mips: Likewise. + * sysdeps/unix/sysv/linux/mips: Likewise. + * sysdeps/mach/mips: Likewise. + * sysdeps/mach/hurd/mips: Likewise. + * shlib-versions: Remove mips matches, now in ports fragment. + * sysdeps/unix/sysv/linux/kernel-features.h: Likewise. + * configure.in (machine): Likewise. + * configure: Regenerated. + + * hurd/hurd/xattr.h: New file. + * hurd/xattr.c: New file. + * hurd/Makefile (routines): Add it. + * sysdeps/mach/hurd/fgetxattr.c: New file. + * sysdeps/mach/hurd/flistxattr.c: New file. + * sysdeps/mach/hurd/fremovexattr.c: New file. + * sysdeps/mach/hurd/fsetxattr.c: New file. + * sysdeps/mach/hurd/getxattr.c: New file. + * sysdeps/mach/hurd/lgetxattr.c: New file. + * sysdeps/mach/hurd/listxattr.c: New file. + * sysdeps/mach/hurd/lsetxattr.c: New file. + * sysdeps/mach/hurd/removexattr.c: New file. + * sysdeps/mach/hurd/setxattr.c: New file. + +2006-02-15 Thomas Schwinge <tschwinge@gnu.org> + + [BZ #2329] + * include/unistd.h (__getresuid, __getresgid, __setresuid) + (__setresgid): Fix argument name order in prototypes. + * posix/unistd.h (getresuid, getresgid, setresuid, setresgid): + Likewise. + * posix/getresuid.c (__getresuid): Fix argument order in definition. + * posix/getresgid.c (__getresgid): Likewise. + * posix/setresuid.c (__setresuid): Likewise. + * posix/setresgid.c (__setresgid): Likewise. + * sysdeps/mach/hurd/getresuid.c (__getresuid): Likewise. + * sysdeps/mach/hurd/getresgid.c (__getresgid): Likewise. + * sysdeps/mach/hurd/setresuid.c (__setresuid): Likewise. + * sysdeps/mach/hurd/setresgid.c (__setresgid): Likewise. + Reported by Samuel Thibault <samuel.thibault@ens-lyon.org>. + +2006-02-13 Mike Frysinger <vapier@gentoo.org> + + [BZ #2380] + * string/tester.c (test_strnlen): New function. + (test_strchr): Call it. + (test_strncat): Test lengths where the sign bit is set. + (test_strncmp): Likewise. + 2006-02-17 Jakub Jelinek <jakub@redhat.com> * include/atomic.h (atomic_and, atomic_or): Define. diff --git a/Makeconfig b/Makeconfig index 64ab926666..cc44b00012 100644 --- a/Makeconfig +++ b/Makeconfig @@ -99,7 +99,20 @@ binfmt-subdir = aout endif # Complete path to sysdep dirs. -export full_config_sysdirs := $(addprefix $(..),$(config-sysdirs)) +# `configure' writes a definition of `config-sysdirs' in `config.make'. +sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D)) + +# Add-ons that contribute sysdeps trees get added to the include list +# after sysdeps/generic. This makes #include <sysdeps/...> work right +# to find specific add-on files without assuming the add-on directory name. +# It also means that headers can go into an add-on's base directory +# instead of the add-on needing a sysdeps/generic of its own. ++sysdep_dirs := $(sysdirs) $(foreach add-on,$(sysdeps-add-ons),\ + $(firstword $(filter /%,$(add-on)) \ + $(..)$(add-on))) +ifdef objdir ++sysdep_dirs := $(objdir) $(+sysdep_dirs) +endif # Run config.status to update config.make and config.h. We don't show the # dependence of config.h to Make, because it is only touched when it @@ -113,16 +126,16 @@ $(common-objpfx)config.make: $(common-objpfx)config.status \ # Find all the add-on and sysdeps configure fragments, to make sure we # re-run configure when any of them changes. $(common-objpfx)config.status: $(..)version.h $(..)configure \ - $(foreach dir,$(full_config_sysdirs),\ - $(wildcard \ - $(dir)/Implies) \ + $(foreach dir,$(sysdirs),\ + $(wildcard $(dir)/Implies) \ $(patsubst %.in,%,\ $(firstword $(wildcard \ $(addprefix $(dir)/,configure configure.in))))) \ $(patsubst %.in,%,\ - $(foreach dir,$(add-ons),\ + $(foreach add-on,$(add-ons),\ $(firstword $(wildcard \ - $(addprefix $(..)$(dir)/,configure configure.in))))) + $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\ + configure configure.in))))) @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \ echo The GNU C library has not been configured. >&2; \ echo Run \`configure\' to configure it before building. >&2; \ @@ -632,11 +645,10 @@ endif # $(+cflags) == "" # include files (including ones given in angle brackets) in the parent # library source directory, in the include directory, and in the # current directory. -# `+sysdep-includes' will be defined by Makerules. -+includes = -I$(..)include \ - $(patsubst %/,-I%,$(objpfx)) $(+sysdep-includes) \ - $(patsubst %/,-I%,$(..)) $(libio-include) $(includes) -I. \ - $(sysincludes) ++sysdep-includes = $(addprefix -I,$(+sysdep_dirs)) ++includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \ + $(+sysdep-includes) $(includes) \ + $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes) # Since libio has several internal header files, we use a -I instead # of many little headers in the include directory. @@ -753,12 +765,10 @@ endif move-if-change = $(SHELL) $(..)scripts/move-if-change --include $(common-objpfx)sysd-dirs - -ifeq ($(sysd-dirs-done),t) -include $(common-objpfx)sysd-sorted subdirs = $(sorted-subdirs) -endif +subdir-srcdirs = $(foreach dir,$(subdirs),\ + $(firstword $($(dir)-srcdir) $(..)$(dir))) ifeq (yes, $(build-shared)) @@ -789,9 +799,8 @@ ifndef avoid-generated # This lets add-ons give more-specific matches that override defaults # in the top-level file. $(common-objpfx)shlib-versions.v.i: \ - $(wildcard $(patsubst %, $(..)%/shlib-versions,$(add-ons) \ - $(config-sysdirs) \ - $(subdirs))) \ + $(wildcard $(+sysdep_dirs:=/shlib-versions) \ + $(subdir-srcdirs:=/shlib-versions)) \ $(..)shlib-versions soversions-default-setname = $(patsubst %, %,\ @@ -891,81 +900,39 @@ endif # These are the subdirectories containing the library source. The order # is more or less arbitrary. The sorting step will take care of the -# dependencies. Only the $(binfmt-subdir) should always be kept at the -# end of the list. +# dependencies. all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ - stdlib stdio-common libio malloc string wcsmbs time dirent \ + stdlib stdio-common libio malloc string wcsmbs time dirent \ grp pwd posix io termios resource misc socket sysvipc gmon \ gnulib iconv iconvdata wctype manual shadow po argp \ - crypt $(add-ons) nss localedata timezone rt conform debug \ - $(sysdep-subdirs) $(dlfcn) $(binfmt-subdir) -all-subdirs := $(filter-out $(sysdep-inhibit-subdirs),$(all-subdirs)) - -# The mach and hurd subdirectories have many generated header files which -# much of the rest of the library depends on, so it is best to build them -# first (and mach before hurd, at that). The before-compile additions in -# sysdeps/{mach,hurd}/Makefile should make it reliably work for these files -# not to exist when making in other directories, but it will be slower that -# way with more somewhat expensive `make' invocations. -subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \ - $(filter-out mach hurd,$(subdirs)) + crypt nss localedata timezone rt conform debug \ + $(add-on-subdirs) $(dlfcn) $(binfmt-subdir) ifndef avoid-generated -all-Subdirs-files = $(wildcard $(config-sysdirs:%=$(..)%/Subdirs)) -$(common-objpfx)sysd-dirs: $(common-objpfx)config.make $(all-Subdirs-files) - $(AWK) 'BEGIN { subdirs = ""; inhibit = "" }; \ - /^#/ { next }; \ - /^[^-]/ { subdirs = subdirs " " $$0 }; \ - /^-/ { inhibit = inhibit " " substr($$0, 2) }; \ - END { printf "sysdep-subdirs =%s\n", subdirs; \ - printf "sysdep-inhibit-subdirs =%s\n", inhibit; \ - print "sysd-dirs-done = t" }' \ - $(patsubst $<,/dev/null,$^) > $@-tmp - mv -f $@-tmp $@ - -all-Depend-files = $(wildcard $(..)*/Depend) -$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk $(all-Depend-files) \ - $(common-objpfx)sysd-dirs $(..)Makeconfig - { { dirs='$(patsubst $(..)%/Depend,%,$(filter %/Depend,$^))'; \ - for d in $$dirs; do \ - while read on; do \ - echo "depend $$d $$on"; \ - done < $(..)$$d/Depend; \ - done; \ - for f in $(all-subdirs); do \ - echo $$f; \ - done; \ - } | $(AWK) -f $< && \ - echo sysd-sorted-done = t; \ - } > $@-tmp +all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\ + $(firstword $($(dir)-srcdir) \ + $(..)$(dir))/Depend)) +$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \ + $(common-objpfx)config.make $(..)Makeconfig \ + $(wildcard $(sysdirs:=/Subdirs)) \ + $(all-Depend-files) + $(AWK) -f $< \ + -v subdirs='$(all-subdirs)' \ + -v srcpfx='$(..)' \ + $(filter %/Subdirs %/Depend,$^) > $@-tmp mv -f $@-tmp $@ $(all-Depend-files): ; endif # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here. -sysdep-makeconfigs := $(wildcard $(patsubst %,$(..)%/Makeconfig,\ - $(config-sysdirs) $(add-ons))) - +sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig)) ifneq (,$(sysdep-makeconfigs)) -Makeconfig-doing-sysdep := $(sysdep-makeconfigs) -# Before each one, include ourselves again to do the bit below that -# will set `Makeconfig-add-on' in an add-on's Makeconfig fragment. -include $(foreach M,$(sysdep-makeconfigs),$(..)Makeconfig $M) +include $(sysdep-makeconfigs) endif endif # Makeconfig not yet included -# The whole body above didn't run when we are included as a subroutine -# of ourselves in the sysdep-makeconfigs include line. This bit runs. -ifneq (,$(Makeconfig-doing-sysdep)) -sysdep-Makeconfig := $(firstword $(Makeconfig-doing-sysdep)) -Makeconfig-doing-sysdep := $(filter-out $(sysdep-Makeconfig),\ - $(Makeconfig-doing-sysdep)) -Makeconfig-add-on := $(filter $(add-ons),$(patsubst $(..)%/Makeconfig,%,\ - $(sysdep-Makeconfig))) -endif - # Local Variables: # mode: makefile # End: diff --git a/Makefile b/Makefile index 8a7fbf307f..8db0ff51f4 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,7 @@ endef configure: configure.in aclocal.m4; $(autoconf-it) %/configure: %/configure.in aclocal.m4; $(autoconf-it) +%/preconfigure: %/preconfigure.in aclocal.m4; $(autoconf-it) endif # $(AUTOCONF) = no @@ -202,7 +203,13 @@ all-subdirs-targets := $(foreach dir,$(subdirs),\ # The action for each of those is to cd into the directory and make the # target there. $(all-subdirs-targets): - $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) + $(MAKE) $(PARALLELMFLAGS) $(subdir-target-args) $(@F) + +define subdir-target-args +subdir=$(@D)$(if $($(@D)-srcdir),\ +-C $($(@D)-srcdir) ..=`pwd`/,\ +-C $(@D) ..=../) +endef .PHONY: $(+subdir_targets) $(all-subdirs-targets) @@ -353,17 +360,16 @@ files-for-dist := README FAQ INSTALL NOTES configure tag-of-stem = glibc-$(subst .,_,$*) # Add-ons in the main repository but distributed in their own tar files. -dist-separate = libidn linuxthreads +dist-separate = libidn # Directories in each add-on. dist-separate-libidn = libidn -dist-separate-linuxthreads = linuxthreads linuxthreads_db glibc-%.tar $(dist-separate:%=glibc-%-%.tar): $(files-for-dist) \ $(foreach D,$(dist-separate),\ $D/configure) @rm -fr glibc-$* - $(MAKE) -q `find sysdeps $(addsuffix /sysdeps,$(add-ons)) \ + $(MAKE) -q `find sysdeps $(addsuffix /sysdeps,$(sysdeps-add-ons)) \ -name configure` cvs $(CVSOPTS) -Q export -d glibc-$* -r $(tag-of-stem) libc # Touch all the configure scripts going into the tarball since cvs export diff --git a/Makerules b/Makerules index a96a03eee4..98a06400b5 100644 --- a/Makerules +++ b/Makerules @@ -56,22 +56,6 @@ ifndef +included-Makeconfig include $(..)Makeconfig endif -# `configure' writes a definition of `config-sysdirs' in `config.make'. -sysdirs = $(strip $(full_config_sysdirs)) - -+sysdir_pfx = $(common-objpfx) - -export sysdirs := $(sysdirs) - -+sysdep_dirs := $(full_config_sysdirs) -ifdef objdir -+sysdep_dirs := $(objdir) $(+sysdep_dirs) -endif - -# Add -I switches to get the right sysdep directories. -# `+includes' in Makeconfig references $(+sysdep-includes). -+sysdep-includes := $(addprefix -I,$(+sysdep_dirs)) - # This variable is used in ``include $(o-iterator)'' after defining # $(o-iterator-doit) to produce some desired rule using $o for the object # suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy @@ -94,7 +78,7 @@ vpath %.x $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \ # being included individually by a subdir makefile (hurd/Makefile needs this). in-Makerules := yes -sysdep-makefiles := $(wildcard $(full_config_sysdirs:=/Makefile)) +sysdep-makefiles := $(wildcard $(sysdirs:=/Makefile)) ifneq (,$(sysdep-makefiles)) include $(sysdep-makefiles) endif @@ -165,7 +149,7 @@ ifndef subdir $(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(common-before-compile) rm -f $@T $@.dT (echo '# Generated from $*.make.c by Makerules.'; \ - $(CC) $(CFLAGS) $(CPPFLAGS) -E $< \ + $(CC) $(CFLAGS) $(CPPFLAGS) -E -DASSEMBLER $< \ -MD -MP -MT '$$(common-objpfx)$*.make' -MF $@.dT \ | sed -n '/@@@/{s/@@@[ ]*\(.*\)@@@/\1/;s/[ ]*$$//p;}'; \ echo 'common-generated += $(@F)'; \ @@ -229,20 +213,22 @@ endef close-check-inhibit-asm = ;; esac ; endif --include $(+sysdir_pfx)sysd-rules +-include $(common-objpfx)sysd-rules ifneq ($(sysd-rules-sysdirs),$(config-sysdirs)) # The value of $(+sysdep_dirs) the sysd-rules was computed for # differs from the one we are using now. So force a rebuild of sysd-rules. sysd-rules-force = FORCE FORCE: endif -$(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \ - $(wildcard $(foreach dir,$(sysdirs),\ - $(dir)/Makefile))\ - $(sysd-rules-force) +$(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \ + $(sysdep-makefiles) $(sysd-rules-force) -@rm -f $@T (echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \ - for dir in $(config-sysdirs:%='$$(..)%'); do \ + for dir in $(config-sysdirs); do \ + case "$$dir" in \ + /*) ;; \ + *) dir="\$$(..)$$dir" ;; \ + esac; \ for o in $(all-object-suffixes); do \ $(open-check-inhibit-asm) \ echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \ @@ -340,7 +326,7 @@ postclean-generated += sysd-versions Versions.all abi-versions.h \ Versions.def.v.i Versions.def.v Versions.v.i Versions.v ifndef avoid-generated -ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs)) +ifneq ($(sysd-versions-subdirs),$(sorted-subdirs) $(config-sysdirs)) sysd-versions-force = FORCE FORCE: endif @@ -358,14 +344,14 @@ $(common-objpfx)Versions.all: $(..)scripts/firstversions.awk \ } | LC_ALL=C $(AWK) -f $< > $@T mv -f $@T $@ # See %.v/%.v.i implicit rules in Makeconfig. -$(common-objpfx)Versions.v.i: $(wildcard $(all-subdirs:%=$(..)%/Versions)) \ +$(common-objpfx)Versions.v.i: $(wildcard $(subdirs:%=$(..)%/Versions)) \ $(wildcard $(sysdirs:%=%/Versions)) \ $(common-objpfx)abi-versions.h \ $(sysd-versions-force) $(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \ $(common-objpfx)Versions.v \ $(..)scripts/versions.awk - ( echo 'sysd-versions-subdirs = $(all-subdirs) $(config-sysdirs)' ; \ + ( echo 'sysd-versions-subdirs = $(subdirs) $(config-sysdirs)' ; \ cat $(word 2,$^) \ | LC_ALL=C $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \ -v move_if_change='$(move-if-change)' \ @@ -1301,18 +1287,12 @@ endif endif -# There's no good place to put this - here will do. -ifeq ($(filter %posix, $(sysdirs)),) -L_tmpnam = 1 -TMP_MAX = 0 -L_ctermid = 1 -L_cuserid = 1 -else -L_tmpnam = 20 -TMP_MAX = 238328 -L_ctermid = 9 -L_cuserid = 9 -endif +# These will have been set by sysdeps/posix/Makefile. +L_tmpnam ?= 1 +TMP_MAX ?= 0 +L_ctermid ?= 1 +L_cuserid ?= 1 + stdio_lim = $(common-objpfx)bits/stdio_lim.h $(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @: diff --git a/Rules b/Rules index 74b80e85ed..5ace24cee0 100644 --- a/Rules +++ b/Rules @@ -27,7 +27,7 @@ endif all: # Don't let the default goal come from Makeconfig. -include ../Makeconfig +include $(firstword $(..) ../)Makeconfig ifndef subdir Each subdirectory makefile must define the `subdir' variable. @@ -65,7 +65,7 @@ endif # See below. This must be set before Makerules processes it. before-compile += $(common-objpfx)bits/stdio_lim.h -include ../Makerules +include $(..)Makerules .PHONY: subdir_lib subdir_lib: lib-noranlib diff --git a/bare/.cvsignore b/bare/.cvsignore deleted file mode 100644 index 3fc9f4cdf1..0000000000 --- a/bare/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.d *.o *.so *.po *.go stamp.* *.stamp *.ustamp *.udeps -*.gz *.Z *.tar *.tgz -=* -TODO COPYING* AUTHORS copyr-* copying.* -glibc-* -distinfo diff --git a/bare/Makefile b/bare/Makefile deleted file mode 100644 index ddfa6ac5e9..0000000000 --- a/bare/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (C) 1994, 1997 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), -# On-Line Applications Research Corporation. -# - -# 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. - -subdir := bare - -bare-routines := brdinit console strtsupp -routines = $(bare-routines) -elided-routines = $(bare-routines) -extra-objs = $(bare-routines:%=%.o) - -install-lib = lib$(config-vendor).a - -include ../Rules - -# -# For bare targets, the $(config-vendor) is the name of the board. -# We will place the board dependent code ONLY in a library which -# is board dependent. This way many target boards can share a -# single libc.a. To resolve all symbols and successfully link -# a program, the application must link against libc.a and libMY_TARGET.a. -# For example, the target specific library for the Motorola MVME135 -# board will be named libmvme135.a. To link a program for the -# MVME135, one must link against -lc and -lmvme135. -# - -lib: $(objpfx)lib$(config-vendor).a - -$(objpfx)lib$(config-vendor).a: $(bare-routines:%=$(objpfx)%.o) -# This library is small enough that it's simplest to recreate the archive -# from scratch each time. - rm -f $@ -ifdef objdir - cd $(objpfx); $(AR) cq$(verbose) $(@:$(objpfx)%=%) $(^:$(objpfx)%=%) -else - $(AR) cq$(verbose) $@ $^ -endif - $(RANLIB) $@ diff --git a/bare/strtsupp.c b/bare/strtsupp.c deleted file mode 100644 index c66495bb3d..0000000000 --- a/bare/strtsupp.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), - On-Line Applications Research Corporation. - - 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 <standalone.h> - -/* This file is only required when a "bare" board is configured. */ - -/* Start Support Routines - -The start code for some CPUs (e.g. i386) require target dependent -support. For more info, consult the start file for your CPU. */ diff --git a/sysdeps/hppa/jmpbuf-offsets.h b/bits/syslog-path.h index d95ed8a419..a1bbd6b216 100644 --- a/sysdeps/hppa/jmpbuf-offsets.h +++ b/bits/syslog-path.h @@ -1,4 +1,4 @@ -/* Private macros for accessing __jmp_buf contents. HPPA version. +/* <bits/syslog-path.h> -- _PATH_LOG definition Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,4 +17,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define JB_SP (76/4) +#ifndef _SYS_SYSLOG_H +# error "Never include this file directly. Use <sys/syslog.h> instead" +#endif + +#ifndef _BITS_SYSLOG_PATH_H +#define _BITS_SYSLOG_PATH_H 1 + +#define _PATH_LOG "/dev/log" + +#endif /* bits/syslog-path.h */ diff --git a/config.h.in b/config.h.in index 147addddef..bbe9d6c463 100644 --- a/config.h.in +++ b/config.h.in @@ -89,13 +89,6 @@ /* Define if static NSS modules are wanted. */ #undef DO_STATIC_NSS -/* Define if gcc uses DWARF2 unwind information for exception support. */ -#undef HAVE_DWARF2_UNWIND_INFO - -/* Define if gcc uses DWARF2 unwind information for exception support - with static variable. */ -#undef HAVE_DWARF2_UNWIND_INFO_STATIC - /* Define if the compiler supports __builtin_expect. */ #undef HAVE_BUILTIN_EXPECT diff --git a/config.make.in b/config.make.in index 871c5d60de..292dea667b 100644 --- a/config.make.in +++ b/config.make.in @@ -88,6 +88,8 @@ build-omitfp = @omitfp@ build-bounded = @bounded@ build-static-nss = @static_nss@ add-ons = @add_ons@ +add-on-subdirs = @add_on_subdirs@ +sysdeps-add-ons = @sysdeps_add_ons@ cross-compiling = @cross_compiling@ force-install = @force_install@ diff --git a/configure b/configure index b1724255c9..557d6fa696 100755 --- a/configure +++ b/configure @@ -313,7 +313,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine submachine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -891,7 +891,6 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gmp=DIRECTORY find GMP source code in DIRECTORY (not needed) --with-gd=DIR find libgd include dir and library with prefix DIR --with-gd-include=DIR find libgd include files in DIR --with-gd-lib=DIR find libgd library files in DIR @@ -1406,22 +1405,6 @@ fi # This will get text that should go into config.make. config_vars= -# Check for a --with-gmp argument and set gmp-srcdir in config.make. - -# Check whether --with-gmp or --without-gmp was given. -if test "${with_gmp+set}" = set; then - withval="$with_gmp" - -case "$with_gmp" in -yes) { { echo "$as_me:$LINENO: error: --with-gmp requires an argument; use --with-gmp=DIRECTORY" >&5 -echo "$as_me: error: --with-gmp requires an argument; use --with-gmp=DIRECTORY" >&2;} - { (exit 1); exit 1; }; } ;; -''|no) ;; -*) config_vars="$config_vars -gmp-srcdir = $withval" ;; -esac - -fi; # Check for a --with-gd argument and set libgd-LDFLAGS in config.make. # Check whether --with-gd or --without-gd was given. @@ -1618,15 +1601,9 @@ fi # Check whether --enable-add-ons or --disable-add-ons was given. if test "${enable_add_ons+set}" = set; then enableval="$enable_add_ons" - case "$enableval" in - yes) add_ons=`cd $srcdir && echo */configure | sed -e 's!/configure!!g'` - add_ons_automatic=yes - test "$add_ons" = "*" && add_ons= ;; - *) add_ons=`echo "$enableval" | sed 's/,/ /g'` - add_ons_automatic=no ;; - esac + else - add_ons= add_ons_automatic=no + enable_add_ons=yes fi; @@ -1844,7 +1821,7 @@ echo "$as_me: error: --with-cpu requires an argument" >&2;} fi; -# An add-on can set this when it the tuple to disable the sanity check below. +# An add-on can set this when it wants to disable the sanity check below. libc_config_ok=no @@ -1852,6 +1829,18 @@ libc_config_ok=no subdirs="$subdirs " +case "$enable_add_ons" in +''|no) add_ons= ;; +yes|'*') + add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps | + sed 's@/[^/]*$@@' | sort | uniq` + add_ons_automatic=yes + ;; +*) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'` + add_ons_automatic=no ;; +esac + +configured_add_ons= add_ons_sfx= add_ons_pfx= if test x"$add_ons" != x; then @@ -1885,13 +1874,6 @@ echo "$as_me: error: { (exit 1); exit 1; }; } ;; esac - - # Test whether such a subdir really exists. - test -d $srcdir/$f || { - { { echo "$as_me:$LINENO: error: add-on directory \"$f\" does not exist" >&5 -echo "$as_me: error: add-on directory \"$f\" does not exist" >&2;} - { (exit 1); exit 1; }; } - } done # Now source each add-on's configure fragment. @@ -1901,19 +1883,81 @@ echo "$as_me: error: add-on directory \"$f\" does not exist" >&2;} # whether it goes into the list to be actually used in the build. use_add_ons= for libc_add_on in $add_ons; do - libc_add_on_frag=$srcdir/$libc_add_on/configure - if test -r $libc_add_on_frag; then - echo "$as_me:$LINENO: result: running configure fragment for add-on $libc_add_on" >&5 -echo "${ECHO_T}running configure fragment for add-on $libc_add_on" >&6 - . $libc_add_on_frag - else - { echo "$as_me:$LINENO: WARNING: add-on fragment $libc_add_on_frag missing" >&5 -echo "$as_me: WARNING: add-on fragment $libc_add_on_frag missing" >&2;} + # Test whether such a directory really exists. + # It can be absolute, or relative to $srcdir, or relative to the build dir. + case "$libc_add_on" in + /*) + libc_add_on_srcdir=$libc_add_on + ;; + *) + test -d "$srcdir/$libc_add_on" || { + if test -d "$libc_add_on"; then + libc_add_on="`pwd`/$libc_add_on" + else + { { echo "$as_me:$LINENO: error: add-on directory \"$libc_add_on\" does not exist" >&5 +echo "$as_me: error: add-on directory \"$libc_add_on\" does not exist" >&2;} + { (exit 1); exit 1; }; } + fi + } + libc_add_on_srcdir=$srcdir/$libc_add_on + ;; + esac + + libc_add_on_frag=$libc_add_on_srcdir/configure + libc_add_on_canonical= + if test -r "$libc_add_on_frag"; then + { echo "$as_me:$LINENO: running configure fragment for add-on $libc_add_on" >&5 +echo "$as_me: running configure fragment for add-on $libc_add_on" >&6;} + libc_add_on_canonical=unknown + libc_add_on_subdirs= + . "$libc_add_on_frag" + test -z "$libc_add_on" || { + configured_add_ons="$configured_add_ons $libc_add_on" + if test "x$libc_add_on_canonical" = xunknown; then + { { echo "$as_me:$LINENO: error: fragment must set \$libc_add_on_canonical" >&5 +echo "$as_me: error: fragment must set \$libc_add_on_canonical" >&2;} + { (exit 1); exit 1; }; } + fi + for d in $libc_add_on_subdirs; do + case "$libc_add_on" in + /*) subdir_srcdir="$libc_add_on" ;; + *) subdir_srcdir="\$(..)$libc_add_on" ;; + esac + case "$d" in + .) + d="${libc_add_on_canonical:-$libc_add_on}" + ;; + /*) + subdir_srcdir="$d" + ;; + *) + subdir_srcdir="$subdir_srcdir/$d" + ;; + esac + d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'` + add_on_subdirs="$add_on_subdirs $d" + test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars +$d-srcdir = $subdir_srcdir" + done + } fi if test -n "$libc_add_on"; then + if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null` + then + echo "$as_me:$LINENO: checking add-on $libc_add_on for preconfigure fragments" >&5 +echo $ECHO_N "checking add-on $libc_add_on for preconfigure fragments... $ECHO_C" >&6 + for frag in $frags; do + name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'` + echo $ECHO_N "$name $ECHO_C" >&6 + . "$frag" + done + echo "$as_me:$LINENO: result: " >&5 +echo "${ECHO_T}" >&6 + fi use_add_ons="$use_add_ons $libc_add_on" add_ons_pfx="$add_ons_pfx $libc_add_on/" - add_ons_sfx="$add_ons_sfx /$libc_add_on" + test -z "$libc_add_on_canonical" || + add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical" fi done # Use echo to strip excess whitespace. @@ -1922,6 +1966,7 @@ fi + ### ### I put this here to prevent those annoying emails from people who cannot ### read and try to compile glibc on unsupported platforms. --drepper @@ -1954,41 +1999,10 @@ a29k | am29000) base_machine=a29k machine=a29k ;; alpha*) base_machine=alpha machine=alpha/$machine ;; c3[012]) base_machine=cx0 machine=cx0/c30 ;; c4[04]) base_machine=cx0 machine=cx0/c40 ;; -hppa*64*) base_machine=hppa machine=hppa/hppa64 ;; -hppa*) base_machine=hppa machine=hppa/hppa1.1 ;; i[34567]86) base_machine=i386 machine=i386/$machine ;; ia64) base_machine=ia64 machine=ia64 ;; -m680?0) base_machine=m68k machine=m68k/$machine ;; -m68k) base_machine=m68k machine=m68k/m68020 ;; m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; -mips64*) base_machine=mips64 - case "$CC $CFLAGS $CPPFLAGS " in - *" -mabi=n32 "*) mips_cc_abi=n32 ;; - *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;; - *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;; - *) mips_cc_abi=default ;; - esac - case $config_os in - *abin32*) mips_config_abi=n32 ;; - *abi64*|*abin64*) mips_config_abi=64 ;; - *abi32*|*abio32*) mips_config_abi=32 ;; - *) mips_config_abi=$mips_cc_abi ;; - esac - case $mips_config_abi in - default) machine=mips/mips64/n32 mips_config_abi=n32 ;; - n32) machine=mips/mips64/n32 ;; - 64) machine=mips/mips64/n64 ;; - 32) machine=mips/mips32/kern64 ;; - esac - machine=$machine/$config_machine - if test $mips_config_abi != $mips_cc_abi; then - # This won't make it to config.make, but we want to - # set this in case configure tests depend on it. - CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi" - fi - ;; -mips*) base_machine=mips machine=mips/mips32/$machine ;; powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; @@ -2002,7 +2016,7 @@ sparcv8 | supersparc | hypersparc) sparcv8plus | sparcv8plusa | sparcv9) base_machine=sparc machine=sparc/sparc32/sparcv9 ;; sparcv8plusb | sparcv9b) - base_machine=sparc machine=sparc/sparc32/sparcv9b ;; + base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;; sparc64) base_machine=sparc machine=sparc/sparc64 ;; sparc64b) @@ -2092,8 +2106,8 @@ done # Find what sysdep directories exist. +sysnames_add_ons= sysnames= -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for b in $base ''; do for m0 in $mach ''; do for v in /$vendor ''; do @@ -2103,17 +2117,27 @@ for b in $base ''; do for m in $mach ''; do for d in $add_ons_pfx ''; do for a in $add_ons_sfx ''; do - if test "$m0$m0sub$b$v$o$m$msub"; then + if test -n "$m0$m0sub$b$v$o$m$msub"; then + try_srcdir="${srcdir}/" + case "$d" in + /*) try_srcdir= ;; + esac try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a" test -n "$enable_debug_configure" && echo "$0 DEBUG: try $try" >&2 - if test -d $srcdir/$try; then + if test -d "$try_srcdir$try"; then sysnames="$sysnames $try" { test -n "$o" || test -n "$b"; } && os_used=t { test -n "$m" || test -n "$m0"; } && machine_used=t case x${m0:-$m} in x*/$submachine) submachine_used=t ;; esac + if test -n "$d"; then + case "$sysnames_add_ons" in + *" $d "*) ;; + *|'') sysnames_add_ons="$sysnames_add_ons $d" ;; + esac + fi fi fi done @@ -2123,19 +2147,6 @@ for b in $base ''; do done done done -for d in $add_ons_pfx ''; do - for a in $add_ons_sfx ''; do - if test -n "$d" && test "$d" != "$a"; then - try="${d}sysdeps/generic${a}" - test -n "$enable_debug_configure" && - echo "$0 DEBUG: try $try" >&2 - if test -d $srcdir/$try; then - sysnames="$sysnames $try" - fi - fi - done -done -IFS="$ac_save_ifs" if test -z "$os_used" && test "$os" != none; then { { echo "$as_me:$LINENO: error: Operating system $os is not supported." >&5 @@ -2222,6 +2233,10 @@ while test $# -gt 0; do then implied="$implied $try" found=yes + case "$sysnames_add_ons" in + *" $d "*) ;; + *|'') sysnames_add_ons="$sysnames_add_ons $d" ;; + esac fi done if test $found = no; then @@ -2261,6 +2276,65 @@ sysnames="$names $default_sysnames" echo "$as_me:$LINENO: result: $default_sysnames" >&5 echo "${ECHO_T}$default_sysnames" >&6 +# Collect the list of add-ons that supply partial sysdeps trees. +sysdeps_add_ons= +for add_on in $add_ons; do + case "$add_on" in + /*) xsrcdir= ;; + *) xsrcdir="$srcdir/" ;; + esac + + test -d "$xsrcdir$add_on/sysdeps" || { + case "$configured_add_ons " in + *" $add_on "*) ;; + *|'') + { { echo "$as_me:$LINENO: error: add-on $add_on has no configure fragment or sysdeps tree" >&5 +echo "$as_me: error: add-on $add_on has no configure fragment or sysdeps tree" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + continue + } + + sysdeps_add_ons="$sysdeps_add_ons $add_on" + case "$sysnames_add_ons" in + *" $add_on/ "*) ;; + *|'') + { echo "$as_me:$LINENO: WARNING: add-on $add_on contributed no sysdeps directories" >&5 +echo "$as_me: WARNING: add-on $add_on contributed no sysdeps directories" >&2;} + continue ;; + esac + + found=no + for d in $sysnames; do + case "$d" in + $add_on/sysdeps/*) ;; + *) continue ;; + esac + (cd "$xsrcdir$d" && for f in *[!~]; do + case "$f" in + sys|bits) + for ff in $f/*.h; do + test -d "$ff" || { test -e "$ff" && exit 88; } + done + ;; + *) + test -d "$f" || { test -e "$f" && exit 88; } + ;; + esac + done) + if test $? -eq 88; then + found=yes + break + fi + done + if test $found = no; then + { echo "$as_me:$LINENO: WARNING: add-on $add_on contributed no useful sysdeps directories" >&5 +echo "$as_me: WARNING: add-on $add_on contributed no useful sysdeps directories" >&2;} + fi +done + + ### Locate tools. @@ -6295,102 +6369,6 @@ _ACEOF fi fi -echo "$as_me:$LINENO: checking for DWARF2 unwind info support" >&5 -echo $ECHO_N "checking for DWARF2 unwind info support... $ECHO_C" >&6 -if test "${libc_cv_gcc_dwarf2_unwind_info+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.c <<EOF -#line $LINENO "configure" -static char *__EH_FRAME_BEGIN__; -_start () -{ -#ifdef CHECK__register_frame - __register_frame (__EH_FRAME_BEGIN__); - __deregister_frame (__EH_FRAME_BEGIN__); -#endif -#ifdef CHECK__register_frame_info - __register_frame_info (__EH_FRAME_BEGIN__); - __deregister_frame_info (__EH_FRAME_BEGIN__); -#endif -} -int __eh_pc; -__throw () {} -/* FIXME: this is fragile. */ -malloc () {} -strcmp () {} -strlen () {} -memcpy () {} -memset () {} -free () {} -abort () {} -__bzero () {} -dl_iterate_phdr () {} -EOF -libc_unwind_check="${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame_info \ - $LDFLAGS \ - -nostdlib -nostartfiles -o conftest conftest.c \ - -lgcc" -# Some platforms' specs put -lgcc first. The second one doesn't hurt. -if { ac_try='$libc_unwind_check >&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } || - { ac_try='$libc_unwind_check -lgcc_eh -lgcc >&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } -then - if $libc_unwind_check -v 2>&1 >/dev/null \ - | grep -- --eh-frame-hdr 2>&1 >/dev/null; then - libc_cv_gcc_dwarf2_unwind_info=no_registry_needed - else - libc_cv_gcc_dwarf2_unwind_info=static - fi -else - libc_cv_gcc_dwarf2_unwind_info=no -fi -if test $libc_cv_gcc_dwarf2_unwind_info = no; then - if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame - $LDFLAGS -nostdlib -nostartfiles - -o conftest conftest.c -lgcc >&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_gcc_dwarf2_unwind_info=yes - else - libc_cv_gcc_dwarf2_unwind_info=no - fi -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $libc_cv_gcc_dwarf2_unwind_info" >&5 -echo "${ECHO_T}$libc_cv_gcc_dwarf2_unwind_info" >&6 -case $libc_cv_gcc_dwarf2_unwind_info in -yes) - cat >>confdefs.h <<\_ACEOF -#define HAVE_DWARF2_UNWIND_INFO 1 -_ACEOF - - ;; -static) - cat >>confdefs.h <<\_ACEOF -#define HAVE_DWARF2_UNWIND_INFO 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define HAVE_DWARF2_UNWIND_INFO_STATIC 1 -_ACEOF - - ;; -esac - echo "$as_me:$LINENO: checking for __builtin_expect" >&5 echo $ECHO_N "checking for __builtin_expect... $ECHO_C" >&6 if test "${libc_cv_gcc_builtin_expect+set}" = set; then @@ -7688,13 +7666,6 @@ if test $shared = default; then shared=$elf fi -if test x"$libc_cv_idn" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBIDN 1 -_ACEOF - -fi - echo "$as_me:$LINENO: checking whether -fPIC is default" >&5 echo $ECHO_N "checking whether -fPIC is default... $ECHO_C" >&6 if test "${pic_default+set}" = set; then @@ -8382,9 +8353,11 @@ s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@subdirs@,$subdirs,;t t s,@add_ons@,$add_ons,;t t +s,@add_on_subdirs@,$add_on_subdirs,;t t s,@base_machine@,$base_machine,;t t s,@submachine@,$submachine,;t t s,@sysnames@,$sysnames,;t t +s,@sysdeps_add_ons@,$sysdeps_add_ons,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t diff --git a/configure.in b/configure.in index dfbf3f1420..f6e7443393 100644 --- a/configure.in +++ b/configure.in @@ -13,18 +13,6 @@ fi # This will get text that should go into config.make. config_vars= -# Check for a --with-gmp argument and set gmp-srcdir in config.make. -AC_ARG_WITH([gmp], - AC_HELP_STRING([--with-gmp=DIRECTORY], - [find GMP source code in DIRECTORY (not needed)]), - [ -case "$with_gmp" in -yes) AC_MSG_ERROR([--with-gmp requires an argument; use --with-gmp=DIRECTORY]) ;; -''|no) ;; -*) config_vars="$config_vars -gmp-srcdir = $withval" ;; -esac -]) # Check for a --with-gd argument and set libgd-LDFLAGS in config.make. AC_ARG_WITH([gd], AC_HELP_STRING([--with-gd=DIR], @@ -186,15 +174,9 @@ fi dnl Generic infrastructure for drop-in additions to libc. AC_ARG_ENABLE([add-ons], AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@], - [configure and build add-ons in DIR1,DIR2,... search for add-ons if no parameter given]), - [case "$enableval" in - yes) add_ons=`cd $srcdir && echo */configure | sed -e 's!/configure!!g'` - add_ons_automatic=yes - test "$add_ons" = "*" && add_ons= ;; - *) add_ons=`echo "$enableval" | sed 's/,/ /g'` - add_ons_automatic=no ;; - esac], - [add_ons= add_ons_automatic=no]) + [configure and build add-ons in DIR1,DIR2,... + search for add-ons if no parameter given]), + , [enable_add_ons=yes]) dnl Let the user avoid using TLS. Don't know why but... AC_ARG_WITH([tls], @@ -344,7 +326,7 @@ AC_ARG_WITH([cpu], ]) -# An add-on can set this when it the tuple to disable the sanity check below. +# An add-on can set this when it wants to disable the sanity check below. libc_config_ok=no dnl Having this here, though empty, makes sure that if add-ons' fragments @@ -352,6 +334,18 @@ dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then dnl our AC_OUTPUT will actually use it. AC_CONFIG_SUBDIRS() +case "$enable_add_ons" in +''|no) add_ons= ;; +yes|'*') + add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps | + sed 's@/[[^/]]*$@@' | sort | uniq` + add_ons_automatic=yes + ;; +*) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'` + add_ons_automatic=no ;; +esac + +configured_add_ons= add_ons_sfx= add_ons_pfx= if test x"$add_ons" != x; then @@ -373,11 +367,6 @@ if test x"$add_ons" != x; then *** \`localedata' add-on.]) ;; esac - - # Test whether such a subdir really exists. - test -d $srcdir/$f || { - AC_MSG_ERROR(add-on directory \"$f\" does not exist) - } done # Now source each add-on's configure fragment. @@ -387,23 +376,81 @@ if test x"$add_ons" != x; then # whether it goes into the list to be actually used in the build. use_add_ons= for libc_add_on in $add_ons; do - libc_add_on_frag=$srcdir/$libc_add_on/configure - if test -r $libc_add_on_frag; then - AC_MSG_RESULT(running configure fragment for add-on $libc_add_on) - . $libc_add_on_frag - else - AC_MSG_WARN(add-on fragment $libc_add_on_frag missing) + # Test whether such a directory really exists. + # It can be absolute, or relative to $srcdir, or relative to the build dir. + case "$libc_add_on" in + /*) + libc_add_on_srcdir=$libc_add_on + ;; + *) + test -d "$srcdir/$libc_add_on" || { + if test -d "$libc_add_on"; then + libc_add_on="`pwd`/$libc_add_on" + else + AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist) + fi + } + libc_add_on_srcdir=$srcdir/$libc_add_on + ;; + esac + + libc_add_on_frag=$libc_add_on_srcdir/configure + libc_add_on_canonical= + if test -r "$libc_add_on_frag"; then + AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on) + libc_add_on_canonical=unknown + libc_add_on_subdirs= + . "$libc_add_on_frag" + test -z "$libc_add_on" || { + configured_add_ons="$configured_add_ons $libc_add_on" + if test "x$libc_add_on_canonical" = xunknown; then + AC_MSG_ERROR(fragment must set \$libc_add_on_canonical) + fi + for d in $libc_add_on_subdirs; do + case "$libc_add_on" in + /*) subdir_srcdir="$libc_add_on" ;; + *) subdir_srcdir="\$(..)$libc_add_on" ;; + esac + case "$d" in + .) + d="${libc_add_on_canonical:-$libc_add_on}" + ;; + /*) + subdir_srcdir="$d" + ;; + *) + subdir_srcdir="$subdir_srcdir/$d" + ;; + esac + d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'` + add_on_subdirs="$add_on_subdirs $d" + test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars +$d-srcdir = $subdir_srcdir" + done + } fi if test -n "$libc_add_on"; then + if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null` + then + AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments) + for frag in $frags; do + name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'` + echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD + . "$frag" + done + AC_MSG_RESULT() + fi use_add_ons="$use_add_ons $libc_add_on" add_ons_pfx="$add_ons_pfx $libc_add_on/" - add_ons_sfx="$add_ons_sfx /$libc_add_on" + test -z "$libc_add_on_canonical" || + add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical" fi done # Use echo to strip excess whitespace. add_ons="`echo $use_add_ons`" fi AC_SUBST(add_ons) +AC_SUBST(add_on_subdirs) ### @@ -440,41 +487,10 @@ a29k | am29000) base_machine=a29k machine=a29k ;; alpha*) base_machine=alpha machine=alpha/$machine ;; c3[012]) base_machine=cx0 machine=cx0/c30 ;; c4[04]) base_machine=cx0 machine=cx0/c40 ;; -hppa*64*) base_machine=hppa machine=hppa/hppa64 ;; -hppa*) base_machine=hppa machine=hppa/hppa1.1 ;; i[34567]86) base_machine=i386 machine=i386/$machine ;; ia64) base_machine=ia64 machine=ia64 ;; -m680?0) base_machine=m68k machine=m68k/$machine ;; -m68k) base_machine=m68k machine=m68k/m68020 ;; m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; -mips64*) base_machine=mips64 - case "$CC $CFLAGS $CPPFLAGS " in - *" -mabi=n32 "*) mips_cc_abi=n32 ;; - *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;; - *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;; - *) mips_cc_abi=default ;; - esac - case $config_os in - *abin32*) mips_config_abi=n32 ;; - *abi64*|*abin64*) mips_config_abi=64 ;; - *abi32*|*abio32*) mips_config_abi=32 ;; - *) mips_config_abi=$mips_cc_abi ;; - esac - case $mips_config_abi in - default) machine=mips/mips64/n32 mips_config_abi=n32 ;; - n32) machine=mips/mips64/n32 ;; - 64) machine=mips/mips64/n64 ;; - 32) machine=mips/mips32/kern64 ;; - esac - machine=$machine/$config_machine - if test $mips_config_abi != $mips_cc_abi; then - # This won't make it to config.make, but we want to - # set this in case configure tests depend on it. - CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi" - fi - ;; -mips*) base_machine=mips machine=mips/mips32/$machine ;; powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; @@ -488,7 +504,7 @@ sparcv8 | supersparc | hypersparc) sparcv8plus | sparcv8plusa | sparcv9) base_machine=sparc machine=sparc/sparc32/sparcv9 ;; sparcv8plusb | sparcv9b) - base_machine=sparc machine=sparc/sparc32/sparcv9b ;; + base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;; sparc64) base_machine=sparc machine=sparc/sparc64 ;; sparc64b) @@ -579,8 +595,8 @@ dnl We are done with glob and regexp uses of [ and ]; return to autoconf. changequote([,])dnl # Find what sysdep directories exist. +sysnames_add_ons= sysnames= -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for b in $base ''; do for m0 in $mach ''; do for v in /$vendor ''; do @@ -590,17 +606,27 @@ for b in $base ''; do for m in $mach ''; do for d in $add_ons_pfx ''; do for a in $add_ons_sfx ''; do - if test "$m0$m0sub$b$v$o$m$msub"; then + if test -n "$m0$m0sub$b$v$o$m$msub"; then + try_srcdir="${srcdir}/" + case "$d" in + /*) try_srcdir= ;; + esac try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a" test -n "$enable_debug_configure" && echo "$0 [DEBUG]: try $try" >&2 - if test -d $srcdir/$try; then + if test -d "$try_srcdir$try"; then sysnames="$sysnames $try" { test -n "$o" || test -n "$b"; } && os_used=t { test -n "$m" || test -n "$m0"; } && machine_used=t case x${m0:-$m} in x*/$submachine) submachine_used=t ;; esac + if test -n "$d"; then + case "$sysnames_add_ons" in + *" $d "*) ;; + *|'') sysnames_add_ons="$sysnames_add_ons $d" ;; + esac + fi fi fi done @@ -610,19 +636,6 @@ for b in $base ''; do done done done -for d in $add_ons_pfx ''; do - for a in $add_ons_sfx ''; do - if test -n "$d" && test "$d" != "$a"; then - try="${d}sysdeps/generic${a}" - test -n "$enable_debug_configure" && - echo "$0 DEBUG: try $try" >&2 - if test -d $srcdir/$try; then - sysnames="$sysnames $try" - fi - fi - done -done -IFS="$ac_save_ifs" if test -z "$os_used" && test "$os" != none; then AC_MSG_ERROR(Operating system $os is not supported.) @@ -703,6 +716,10 @@ while test $# -gt 0; do then implied="$implied $try" found=yes + case "$sysnames_add_ons" in + *" $d "*) ;; + *|'') sysnames_add_ons="$sysnames_add_ons $d" ;; + esac fi done if test $found = no; then @@ -742,6 +759,61 @@ AC_SUBST(sysnames) # The other names were emitted during the scan. AC_MSG_RESULT($default_sysnames) +# Collect the list of add-ons that supply partial sysdeps trees. +sysdeps_add_ons= +for add_on in $add_ons; do + case "$add_on" in + /*) xsrcdir= ;; + *) xsrcdir="$srcdir/" ;; + esac + + test -d "$xsrcdir$add_on/sysdeps" || { + case "$configured_add_ons " in + *" $add_on "*) ;; + *|'') + AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree) + ;; + esac + continue + } + + sysdeps_add_ons="$sysdeps_add_ons $add_on" + case "$sysnames_add_ons" in + *" $add_on/ "*) ;; + *|'') + AC_MSG_WARN(add-on $add_on contributed no sysdeps directories) + continue ;; + esac + + found=no + for d in $sysnames; do + case "$d" in + $add_on/sysdeps/*) ;; + *) continue ;; + esac + (cd "$xsrcdir$d" && for f in *[[!~]]; do + case "$f" in + sys|bits) + for ff in $f/*.h; do + test -d "$ff" || { test -e "$ff" && exit 88; } + done + ;; + *) + test -d "$f" || { test -e "$f" && exit 88; } + ;; + esac + done) + if test $? -eq 88; then + found=yes + break + fi + done + if test $found = no; then + AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories) + fi +done +AC_SUBST(sysdeps_add_ons) + ### Locate tools. @@ -1753,71 +1825,6 @@ if test "$libc_cv_c_asmcr0_bug" != 'no'; then fi fi -AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info, -[cat > conftest.c <<EOF -#line $LINENO "configure" -static char *__EH_FRAME_BEGIN__; -_start () -{ -#ifdef CHECK__register_frame - __register_frame (__EH_FRAME_BEGIN__); - __deregister_frame (__EH_FRAME_BEGIN__); -#endif -#ifdef CHECK__register_frame_info - __register_frame_info (__EH_FRAME_BEGIN__); - __deregister_frame_info (__EH_FRAME_BEGIN__); -#endif -} -int __eh_pc; -__throw () {} -/* FIXME: this is fragile. */ -malloc () {} -strcmp () {} -strlen () {} -memcpy () {} -memset () {} -free () {} -abort () {} -__bzero () {} -dl_iterate_phdr () {} -EOF -libc_unwind_check="${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame_info \ - $LDFLAGS \ - -nostdlib -nostartfiles -o conftest conftest.c \ - -lgcc" -# Some platforms' specs put -lgcc first. The second one doesn't hurt. -if AC_TRY_COMMAND([$libc_unwind_check >&AS_MESSAGE_LOG_FD]) || - AC_TRY_COMMAND([$libc_unwind_check -lgcc_eh -lgcc >&AS_MESSAGE_LOG_FD]) -then - if $libc_unwind_check -v 2>&1 >/dev/null \ - | grep -- --eh-frame-hdr 2>&1 >/dev/null; then - libc_cv_gcc_dwarf2_unwind_info=no_registry_needed - else - libc_cv_gcc_dwarf2_unwind_info=static - fi -else - libc_cv_gcc_dwarf2_unwind_info=no -fi -if test $libc_cv_gcc_dwarf2_unwind_info = no; then - if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame - $LDFLAGS -nostdlib -nostartfiles - -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then - libc_cv_gcc_dwarf2_unwind_info=yes - else - libc_cv_gcc_dwarf2_unwind_info=no - fi -fi -rm -f conftest*]) -case $libc_cv_gcc_dwarf2_unwind_info in -yes) - AC_DEFINE(HAVE_DWARF2_UNWIND_INFO) - ;; -static) - AC_DEFINE(HAVE_DWARF2_UNWIND_INFO) - AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC) - ;; -esac - dnl Check whether compiler understands __builtin_expect. AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect, [cat > conftest.c <<EOF @@ -2118,10 +2125,6 @@ if test $shared = default; then shared=$elf fi -if test x"$libc_cv_idn" = xyes; then - AC_DEFINE(HAVE_LIBIDN) -fi - AC_CACHE_CHECK([whether -fPIC is default], pic_default, [pic_default=yes cat > conftest.c <<EOF diff --git a/csu/Makefile b/csu/Makefile index 550dc2983c..54af0d6662 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -1,5 +1,5 @@ # Makefile for csu code for GNU C library. -# Copyright (C) 1995-2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1995-2004, 2005, 2006 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 @@ -95,7 +95,7 @@ $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) -vpath initfini.c $(full_config_sysdirs) +vpath initfini.c $(sysdirs) $(objpfx)initfini.s: initfini.c $(before-compile) $(compile.c) -S $(CFLAGS-initfini.s) -finhibit-size-directive \ @@ -200,8 +200,7 @@ $(objpfx)abi-tag.h: $(..)abi-tags if test -r $@.new; then mv -f $@.new $@; \ else echo >&2 'This configuration not matched in $<'; exit 1; fi -all-Banner-files = $(wildcard $(addsuffix /Banner, \ - $(addprefix $(..), $(subdirs)))) +all-Banner-files = $(wildcard $(addsuffix /Banner,$(subdir-srcdirs))) $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files) $(make-target-directory) (case $(config-os) in \ diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h index 42c25b8b63..7e373eddf9 100644 --- a/dlfcn/dlfcn.h +++ b/dlfcn/dlfcn.h @@ -1,5 +1,6 @@ /* User functions for run-time dynamic loading. - Copyright (C) 1995-1999,2000,2001,2003,2004 Free Software Foundation, Inc. + Copyright (C) 1995-1999,2000,2001,2003,2004,2006 + 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 @@ -135,6 +136,8 @@ enum store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, + RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ + /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' @@ -147,7 +150,21 @@ enum expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, - RTLD_DI_CONFIGADDR = 3 /* Unsupported, defined by Solaris. */ + RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ + RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ + + /* Treat ARG as `size_t *', and store there the TLS module ID + of this object's PT_TLS segment, as used in TLS relocations; + store zero if this object does not define a PT_TLS segment. */ + RTLD_DI_TLS_MODID = 9, + + /* Treat ARG as `void **', and store there a pointer to the calling + thread's TLS block corresponding to this object's PT_TLS segment. + Store a null pointer if this object does not define a PT_TLS + segment, or if the calling thread has not allocated a block for it. */ + RTLD_DI_TLS_DATA = 10, + + RTLD_DI_MAX = 10, }; diff --git a/dlfcn/dlinfo.c b/dlfcn/dlinfo.c index 44af55a303..b1e2b009a5 100644 --- a/dlfcn/dlinfo.c +++ b/dlfcn/dlinfo.c @@ -1,5 +1,5 @@ /* dlinfo -- Get information from the dynamic linker. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006 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 @@ -32,6 +32,10 @@ dlinfo (void *handle, int request, void *arg) #else +# ifdef USE_TLS +# include <dl-tls.h> +# endif + struct dlinfo_args { ElfW(Addr) caller; @@ -90,6 +94,24 @@ RTLD_SELF used in code not dynamically loaded")); case RTLD_DI_ORIGIN: strcpy (args->arg, l->l_origin); break; + + case RTLD_DI_TLS_MODID: + *(size_t *) args->arg = 0; +#ifdef USE_TLS + *(size_t *) args->arg = l->l_tls_modid; +#endif + break; + + case RTLD_DI_TLS_DATA: + { + void *data = NULL; +#ifdef USE_TLS + if (l->l_tls_modid != 0) + data = _dl_tls_get_addr_soft (l); +#endif + *(void **) args->arg = data; + break; + } } } diff --git a/elf/Makefile b/elf/Makefile index 5cd78c2f83..791341758e 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -163,9 +163,11 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ neededtest3 neededtest4 unload2 lateglobal initfirst global \ restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \ - tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 tst-align \ - tst-align2 $(tests-execstack-$(have-z-execstack)) tst-dlmodcount \ - tst-dlopenrpath tst-deep1 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ + tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ + tst-tls-dlinfo \ + tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \ + tst-dlmodcount tst-dlopenrpath tst-deep1 \ + tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ unload3 unload4 unload5 unload6 tst-audit1 tst-global1 order2 \ tst-stackguard1 # reldep9 @@ -700,6 +702,11 @@ $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so $(objpfx)tst-tls15: $(libdl) $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so +$(objpfx)tst-tls-dlinfo: $(libdl) +$(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so + + + CFLAGS-tst-align.c = $(stack-align-test-flags) CFLAGS-tst-align2.c = $(stack-align-test-flags) CFLAGS-tst-alignmod.c = $(stack-align-test-flags) diff --git a/elf/Versions b/elf/Versions index 87e27c5a7a..967ebdb3a5 100644 --- a/elf/Versions +++ b/elf/Versions @@ -57,6 +57,7 @@ ld { _dl_allocate_tls; _dl_deallocate_tls; _dl_get_tls_static_info; _dl_allocate_tls_init; _dl_tls_setup; _dl_rtld_di_serinfo; + _dl_tls_get_addr_soft; _dl_make_stack_executable; # Only here for gdb while a better method is developed. _dl_debug_state; diff --git a/elf/circleload1.c b/elf/circleload1.c index f5f886a1da..990ff84a84 100644 --- a/elf/circleload1.c +++ b/elf/circleload1.c @@ -5,6 +5,8 @@ #include <stdlib.h> #include <string.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + static int check_loaded_objects (const char **loaded) { @@ -24,7 +26,7 @@ check_loaded_objects (const char **loaded) printf(" Name\n"); printf(" --------------------------------------------------------\n"); - for (lm = _r_debug.r_map; lm; lm = lm->l_next) + for (lm = MAPS; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); diff --git a/elf/dl-debug.c b/elf/dl-debug.c index bc7d793435..d00fe87fbb 100644 --- a/elf/dl-debug.c +++ b/elf/dl-debug.c @@ -1,5 +1,6 @@ /* Communicate dynamic linker state to the debugger at runtime. - Copyright (C) 1996, 1998,2000,2002,2004,2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1998,2000,2002,2004,2005,2006 + 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 @@ -19,6 +20,18 @@ #include <ldsodefs.h> + +/* These are the members in the public `struct link_map' type. + Sanity check that the internal type and the public type match. */ +#define VERIFY_MEMBER(name) \ + (offsetof (struct link_map_public, name) == offsetof (struct link_map, name)) +extern const int verify_link_map_members[(VERIFY_MEMBER (l_addr) + && VERIFY_MEMBER (l_name) + && VERIFY_MEMBER (l_ld) + && VERIFY_MEMBER (l_next) + && VERIFY_MEMBER (l_prev)) + ? 1 : -1]; + /* This structure communicates dl state to the debugger. The debugger normally finds it via the DT_DEBUG entry in the dynamic section, but in a statically-linked program there is no dynamic section for the debugger @@ -46,7 +59,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) /* Tell the debugger where to find the map of loaded objects. */ r->r_version = 1 /* R_DEBUG_VERSION XXX */; r->r_ldbase = ldbase ?: _r_debug.r_ldbase; - r->r_map = GL(dl_ns)[ns]._ns_loaded; + r->r_map = (void *) GL(dl_ns)[ns]._ns_loaded; r->r_brk = (ElfW(Addr)) &_dl_debug_state; } diff --git a/elf/dl-iteratephdr.c b/elf/dl-iteratephdr.c index 6ed90c73b1..52a114421d 100644 --- a/elf/dl-iteratephdr.c +++ b/elf/dl-iteratephdr.c @@ -1,5 +1,5 @@ /* Get loaded objects program headers. - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001,2002,2003,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2001. @@ -68,6 +68,13 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, info.dlpi_phnum = l->l_phnum; info.dlpi_adds = GL(dl_load_adds); info.dlpi_subs = GL(dl_load_adds) - nloaded; + info.dlpi_tls_modid = 0; + info.dlpi_tls_data = NULL; +#ifdef USE_TLS + info.dlpi_tls_modid = l->l_tls_modid; + if (info.dlpi_tls_modid != 0) + info.dlpi_tls_data = _dl_tls_get_addr_soft (l); +#endif ret = callback (&info, sizeof (struct dl_phdr_info), data); if (ret) break; diff --git a/elf/dl-sym.c b/elf/dl-sym.c index ca83daf21d..d2b0ec0dab 100644 --- a/elf/dl-sym.c +++ b/elf/dl-sym.c @@ -1,5 +1,5 @@ /* Look up a symbol in a shared object loaded by `dlopen'. - Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1999,2000,2001,2002,2004,2006 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 @@ -103,7 +103,7 @@ RTLD_NEXT used in code not dynamically loaded")); while (l->l_loader != NULL) l = l->l_loader; - result = GLRO(dl_lookup_symbol_x) (name, l, &ref, l->l_local_scope, + result = GLRO(dl_lookup_symbol_x) (name, match, &ref, l->l_local_scope, vers, 0, 0, match); } else diff --git a/elf/dl-tls.c b/elf/dl-tls.c index 4fed570d5c..a0f4f77ffa 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. Generic version. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002,2003,2004,2005,2006 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 @@ -735,9 +735,53 @@ __tls_get_addr (GET_ADDR_ARGS) # endif +/* Look up the module's TLS block as for __tls_get_addr, + but never touch anything. Return null if it's not allocated yet. */ +void * +internal_function +_dl_tls_get_addr_soft (struct link_map *l) +{ + if (__builtin_expect (l->l_tls_modid == 0, 0)) + /* This module has no TLS segment. */ + return NULL; + + dtv_t *dtv = THREAD_DTV (); + if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0)) + { + /* This thread's DTV is not completely current, + but it might already cover this module. */ + + if (l->l_tls_modid >= dtv[-1].counter) + /* Nope. */ + return NULL; + + size_t idx = l->l_tls_modid; + struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list); + while (idx >= listp->len) + { + idx -= listp->len; + listp = listp->next; + } + + /* We've reached the slot for this module. + If its generation counter is higher than the DTV's, + this thread does not know about this module yet. */ + if (dtv[0].counter < listp->slotinfo[idx].gen) + return NULL; + } + + void *data = dtv[l->l_tls_modid].pointer.val; + if (__builtin_expect (data == TLS_DTV_UNALLOCATED, 0)) + /* The DTV is current, but this thread has not yet needed + to allocate this module's segment. */ + data = NULL; + + return data; +} + void -_dl_add_to_slotinfo (struct link_map *l) +_dl_add_to_slotinfo (struct link_map *l) { /* Now that we know the object is loaded successfully add modules containing TLS data to the dtv info table. We diff --git a/elf/do-lookup.h b/elf/do-lookup.h index 62755ea013..7b62b0feec 100644 --- a/elf/do-lookup.h +++ b/elf/do-lookup.h @@ -1,5 +1,5 @@ /* Look up a symbol in the loaded objects. - Copyright (C) 1995-2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2004, 2005, 2006 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 @@ -45,7 +45,7 @@ do_lookup_x (const char *undef_name, unsigned long int hash, map = list[i]->l_real; /* Here come the extra test needed for `_dl_lookup_symbol_skip'. */ - if (skip != NULL && map == skip) + if (map == skip) continue; /* Don't search the executable when resolving a copy reloc. */ diff --git a/elf/elf.h b/elf/elf.h index c98bb5233d..344f252c0c 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2003,2004,2005,2006 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 @@ -1250,14 +1250,15 @@ typedef struct #define DT_SPARC_REGISTER 0x70000001 #define DT_SPARC_NUM 2 -/* Bits present in AT_HWCAP, primarily for Sparc32. */ +/* Bits present in AT_HWCAP on SPARC. */ -#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */ +#define HWCAP_SPARC_FLUSH 1 /* The CPU supports flush insn. */ #define HWCAP_SPARC_STBAR 2 #define HWCAP_SPARC_SWAP 4 #define HWCAP_SPARC_MULDIV 8 -#define HWCAP_SPARC_V9 16 /* The cpu is v9, so v8plus is ok. */ +#define HWCAP_SPARC_V9 16 /* The CPU is v9, so v8plus is ok. */ #define HWCAP_SPARC_ULTRA3 32 +#define HWCAP_SPARC_BLKINIT 64 /* Sun4v with block-init/load-twin. */ /* MIPS R3000 specific definitions. */ diff --git a/elf/link.h b/elf/link.h index fdda019cbe..076531d6e7 100644 --- a/elf/link.h +++ b/elf/link.h @@ -1,6 +1,6 @@ /* Data structure for communication from the run-time dynamic linker for loaded ELF shared objects. - Copyright (C) 1995-2001, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2001, 2004, 2005, 2006 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 @@ -135,7 +135,6 @@ enum la_symbind call. */ }; - struct dl_phdr_info { ElfW(Addr) dlpi_addr; @@ -143,15 +142,24 @@ struct dl_phdr_info const ElfW(Phdr) *dlpi_phdr; ElfW(Half) dlpi_phnum; - /* Note: the next two members were introduced after the first + /* Note: Following members were introduced after the first version of this structure was available. Check the SIZE - argument passed to the dl_iterate_phdr() callback to determine - whether or not they are provided. */ + argument passed to the dl_iterate_phdr callback to determine + whether or not each later member is available. */ /* Incremented when a new object may have been added. */ unsigned long long int dlpi_adds; /* Incremented when an object may have been removed. */ unsigned long long int dlpi_subs; + + /* If there is a PT_TLS segment, its module ID as used in + TLS relocations, else zero. */ + size_t dlpi_tls_modid; + + /* The address of the calling thread's instance of this module's + PT_TLS segment, if it has one and it has been allocated + in the calling thread, otherwise a null pointer. */ + void *dlpi_tls_data; }; __BEGIN_DECLS diff --git a/elf/loadtest.c b/elf/loadtest.c index ee106ea152..727469b496 100644 --- a/elf/loadtest.c +++ b/elf/loadtest.c @@ -70,8 +70,10 @@ static const struct #include <include/link.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + #define OUT \ - for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ + for (map = MAPS; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ printf ("name = \"%s\", direct_opencount = %d\n", \ map->l_name, (int) map->l_direct_opencount); \ @@ -147,7 +149,7 @@ main (int argc, char *argv[]) { /* In this case none of the objects above should be present. */ - for (map = _r_debug.r_map; map != NULL; map = map->l_next) + for (map = MAPS; map != NULL; map = map->l_next) if (map->l_type == lt_loaded && (strstr (map->l_name, testobjs[0].name) != NULL || strstr (map->l_name, testobjs[1].name) != NULL @@ -180,7 +182,7 @@ main (int argc, char *argv[]) } /* Check whether all files are unloaded. */ - for (map = _r_debug.r_map; map != NULL; map = map->l_next) + for (map = MAPS; map != NULL; map = map->l_next) if (map->l_type == lt_loaded) { printf ("name = \"%s\", direct_opencount = %d\n", diff --git a/elf/neededtest.c b/elf/neededtest.c index 6c7a952066..3cea499314 100644 --- a/elf/neededtest.c +++ b/elf/neededtest.c @@ -5,6 +5,8 @@ #include <stdlib.h> #include <string.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + static int check_loaded_objects (const char **loaded) { @@ -24,7 +26,7 @@ check_loaded_objects (const char **loaded) printf(" Name\n"); printf(" --------------------------------------------------------\n"); - for (lm = _r_debug.r_map; lm; lm = lm->l_next) + for (lm = MAPS; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); diff --git a/elf/neededtest2.c b/elf/neededtest2.c index b682f15792..17c75f2ba3 100644 --- a/elf/neededtest2.c +++ b/elf/neededtest2.c @@ -5,6 +5,8 @@ #include <stdlib.h> #include <string.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + static int check_loaded_objects (const char **loaded) { @@ -24,7 +26,7 @@ check_loaded_objects (const char **loaded) printf(" Name\n"); printf(" --------------------------------------------------------\n"); - for (lm = _r_debug.r_map; lm; lm = lm->l_next) + for (lm = MAPS; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); diff --git a/elf/neededtest3.c b/elf/neededtest3.c index ea1dcf4794..41970cf2c7 100644 --- a/elf/neededtest3.c +++ b/elf/neededtest3.c @@ -5,6 +5,8 @@ #include <stdlib.h> #include <string.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + static int check_loaded_objects (const char **loaded) { @@ -24,7 +26,7 @@ check_loaded_objects (const char **loaded) printf(" Name\n"); printf(" --------------------------------------------------------\n"); - for (lm = _r_debug.r_map; lm; lm = lm->l_next) + for (lm = MAPS; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); diff --git a/elf/neededtest4.c b/elf/neededtest4.c index 7514bed499..bd79341fb2 100644 --- a/elf/neededtest4.c +++ b/elf/neededtest4.c @@ -5,6 +5,8 @@ #include <stdlib.h> #include <string.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + static int check_loaded_objects (const char **loaded) { @@ -24,7 +26,7 @@ check_loaded_objects (const char **loaded) printf(" Name\n"); printf(" --------------------------------------------------------\n"); - for (lm = _r_debug.r_map; lm; lm = lm->l_next) + for (lm = MAPS; lm; lm = lm->l_next) { if (lm->l_name && lm->l_name[0]) printf(" %s, count = %d\n", lm->l_name, (int) lm->l_direct_opencount); diff --git a/elf/rtld-Rules b/elf/rtld-Rules index 61143b180c..01fbbdf0c5 100644 --- a/elf/rtld-Rules +++ b/elf/rtld-Rules @@ -1,6 +1,6 @@ # Subroutine makefile for compiling libc modules linked into dynamic linker. -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 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 @@ -72,10 +72,16 @@ include $(patsubst %,../o-iterator.mk,$(object-suffixes-left)) # This is how we descend into each subdirectory. See below. define rtld-subdir-make -$(MAKE) -C ../$* objdir=$(objdir) -f Makefile -f ../elf/rtld-Rules rtld-all \ +$(MAKE) $(subdir-args) objdir=$(objdir) \ + -f Makefile -f ../elf/rtld-Rules rtld-all \ rtld-modules='$(addprefix rtld-,$(rtld-$*))' endef +# See subdir-target-args in ../Makefile for the model. +subdir-args = subdir=$*$(if $($*-srcdir),\ + -C $($*-srcdir) ..=`pwd`/,\ + -C $(..)$* ..=../) + FORCE: else diff --git a/elf/sofini.c b/elf/sofini.c index 16e77e72ad..5e06f0ca92 100644 --- a/elf/sofini.c +++ b/elf/sofini.c @@ -8,12 +8,10 @@ static void (*const __DTOR_END__[1]) (void) __attribute__ ((used, section (".dtors"))) = { 0 }; -#ifdef HAVE_DWARF2_UNWIND_INFO /* Terminate the frame unwind info section with a 4byte 0 as a sentinel; this would be the 'length' field in a real FDE. */ typedef unsigned int ui32 __attribute__ ((mode (SI))); -static ui32 __FRAME_END__[1] - __attribute__ ((used, section (".eh_frame"))) - = { 0 }; -#endif +static const ui32 __FRAME_END__[1] + __attribute__ ((used, section (".eh_frame"))) + = { 0 }; diff --git a/elf/soinit.c b/elf/soinit.c index 29e4707ceb..c0a881ef5d 100644 --- a/elf/soinit.c +++ b/elf/soinit.c @@ -6,10 +6,6 @@ #include <libc-internal.h> #include <stdlib.h> -#ifdef HAVE_DWARF2_UNWIND_INFO_STATIC -# include <gccframe.h> -#endif - static void (*const __CTOR_LIST__[1]) (void) __attribute__ ((section (".ctors"))) = { (void (*) (void)) -1 }; @@ -24,21 +20,9 @@ run_hooks (void (*const list[]) (void)) (**list) (); } -#ifdef HAVE_DWARF2_UNWIND_INFO -static char __EH_FRAME_BEGIN__[] - __attribute__ ((section (".eh_frame"))) - = { }; -# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC -extern void __register_frame_info (const void *, struct object *); -extern void __register_frame_info_bases (const void *, struct object *, - void *, void *); -extern void __deregister_frame_info (const void *); -extern void __deregister_frame_info_bases (const void *); -# else -extern void __register_frame (const void *); -extern void __deregister_frame (const void *); -# endif -#endif +static const char __EH_FRAME_BEGIN__[] + __attribute__ ((used, section (".eh_frame"))) + = { }; /* This function will be called from _init in init-first.c. */ void @@ -46,33 +30,6 @@ __libc_global_ctors (void) { /* Call constructor functions. */ run_hooks (__CTOR_LIST__); - -#ifdef HAVE_DWARF2_UNWIND_INFO -# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC - { - static struct object ob; -# if defined CRT_GET_RFIB_TEXT || defined CRT_GET_RFIB_DATA - void *tbase, *dbase; - -# ifdef CRT_GET_RFIB_TEXT - CRT_GET_RFIB_TEXT (tbase); -# else - tbase = NULL; -# endif -# ifdef CRT_GET_RFIB_DATA - CRT_GET_RFIB_DATA (dbase); -# else - dbase = NULL; -# endif - __register_frame_info_bases (__EH_FRAME_BEGIN__, &ob, tbase, dbase); -# else - __register_frame_info (__EH_FRAME_BEGIN__, &ob); -# endif - } -# else - __register_frame (__EH_FRAME_BEGIN__); -# endif -#endif } @@ -83,17 +40,6 @@ __libc_fini (void) { /* Call destructor functions. */ run_hooks (__DTOR_LIST__); -#ifdef HAVE_DWARF2_UNWIND_INFO -# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC -# if defined CRT_GET_RFIB_TEXT || defined CRT_GET_RFIB_DATA - __deregister_frame_info_bases (__EH_FRAME_BEGIN__); -# else - __deregister_frame_info (__EH_FRAME_BEGIN__); -# endif -# else - __deregister_frame (__EH_FRAME_BEGIN__); -# endif -#endif } void (*_fini_ptr) (void) __attribute__ ((section (".fini_array"))) diff --git a/elf/tst-tls-dlinfo.c b/elf/tst-tls-dlinfo.c new file mode 100644 index 0000000000..e97b5081fd --- /dev/null +++ b/elf/tst-tls-dlinfo.c @@ -0,0 +1,92 @@ +#include <dlfcn.h> +#include <stdio.h> +#include <stdlib.h> + +#include <tls.h> + + +#define TEST_FUNCTION do_test () +static int +do_test (void) +{ +#ifdef USE_TLS + static const char modname[] = "tst-tlsmod2.so"; + int result = 0; + int *foop; + int (*fp) (int, int *); + void *h; + + h = dlopen (modname, RTLD_LAZY); + if (h == NULL) + { + printf ("cannot open '%s': %s\n", modname, dlerror ()); + exit (1); + } + + fp = dlsym (h, "in_dso"); + if (fp == NULL) + { + printf ("cannot get symbol 'in_dso': %s\n", dlerror ()); + exit (1); + } + + size_t modid = -1; + if (dlinfo (h, RTLD_DI_TLS_MODID, &modid)) + { + printf ("dlinfo RTLD_DI_TLS_MODID failed: %s\n", dlerror ()); + result = 1; + } + else + printf ("dlinfo says TLS module ID %Zu\n", modid); + + void *block; + if (dlinfo (h, RTLD_DI_TLS_DATA, &block)) + { + printf ("dlinfo RTLD_DI_TLS_DATA failed: %s\n", dlerror ()); + result = 1; + } + else if (block != NULL) + { + printf ("dlinfo RTLD_DI_TLS_DATA says %p but should be unallocated\n", + block); + result = 1; + } + + result |= fp (0, NULL); + + foop = dlsym (h, "foo"); + if (foop == NULL) + { + printf ("cannot get symbol 'foo' the second time: %s\n", dlerror ()); + exit (1); + } + if (*foop != 16) + { + puts ("foo != 16"); + result = 1; + } + + /* Now the module's TLS block has been used and should appear. */ + if (dlinfo (h, RTLD_DI_TLS_DATA, &block)) + { + printf ("dlinfo RTLD_DI_TLS_DATA failed the second time: %s\n", + dlerror ()); + result = 1; + } + else if (block != foop) + { + printf ("dlinfo RTLD_DI_TLS_DATA says %p but should be %p\n", + block, foop); + result = 1; + } + + dlclose (h); + + return result; +#else + return 0; +#endif +} + + +#include "../test-skeleton.c" diff --git a/elf/unload.c b/elf/unload.c index ffb33482c0..4566f226f8 100644 --- a/elf/unload.c +++ b/elf/unload.c @@ -9,8 +9,10 @@ #include <stdio.h> #include <stdlib.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + #define OUT \ - for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ + for (map = MAPS; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ printf ("name = \"%s\", direct_opencount = %d\n", \ map->l_name, (int) map->l_direct_opencount); \ diff --git a/elf/unload2.c b/elf/unload2.c index e14c6f06af..eef2bfd426 100644 --- a/elf/unload2.c +++ b/elf/unload2.c @@ -6,8 +6,10 @@ #include <stdio.h> #include <stdlib.h> +#define MAPS ((struct link_map *) _r_debug.r_map) + #define OUT \ - for (map = _r_debug.r_map; map != NULL; map = map->l_next) \ + for (map = MAPS; map != NULL; map = map->l_next) \ if (map->l_type == lt_loaded) \ printf ("name = \"%s\", direct_opencount = %d\n", \ map->l_name, (int) map->l_direct_opencount); \ diff --git a/fedora/branch.mk b/fedora/branch.mk index 2768f05c5e..ac6775bb5e 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-fc4 -fedora-sync-date := 2006-02-17 16:09 UTC -fedora-sync-tag := fedora-glibc-20060217T1609 +fedora-sync-date := 2006-03-01 06:47 UTC +fedora-sync-tag := fedora-glibc-20060301T0647 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 06cd9181c6..a3902477da 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 38 +%define glibcrelease 39 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define prelinkarches noarch %define xenarches i686 athlon @@ -1332,6 +1332,9 @@ rm -f *.filelist* %endif %changelog +* Wed Mar 1 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-39 +- update from CVS + * Fri Feb 17 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-38 - update from CVS - robust mutexes rewrite diff --git a/hurd/Depend b/hurd/Depend new file mode 100644 index 0000000000..b108b245b8 --- /dev/null +++ b/hurd/Depend @@ -0,0 +1,9 @@ +# This file says that the mach subdirectory should appear before this one. +# The mach and hurd subdirectories have many generated header files which +# much of the rest of the library depends on, so it is best to build them +# first (and mach before hurd, at that). The before-compile additions in +# sysdeps/{mach,hurd}/Makefile should make it reliably work for these files +# not to exist when making in other directories, but it will be slower that +# way with more somewhat expensive `make' invocations. + +mach diff --git a/hurd/Makefile b/hurd/Makefile index ccf596c918..5d99429f79 100644 --- a/hurd/Makefile +++ b/hurd/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99,2001,2002 +# Copyright (C) 1991,92,93,94,95,96,97,98,99,2001,2002,2004 # Free Software Foundation, Inc. # This file is part of the GNU C Library. @@ -60,7 +60,7 @@ routines = hurdstartup hurdinit \ vpprintf \ ports-get ports-set hurdports hurdmsg \ errno-loc \ - $(sig) $(dtable) $(inlines) port-cleanup report-wait + $(sig) $(dtable) $(inlines) port-cleanup report-wait xattr sig = hurdsig hurdfault siginfo hurd-raise preempt-sig \ trampoline longjmp-ts catch-exc exc2signal hurdkill sigunwind \ thread-self thread-cancel intr-msg catch-signal diff --git a/nptl/sysdeps/mips/pthreaddef.h b/hurd/hurd/xattr.h index e72b4bc58d..aaa7fd8eaa 100644 --- a/nptl/sysdeps/mips/pthreaddef.h +++ b/hurd/hurd/xattr.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +/* Access to extended attributes on files for GNU/Hurd. + Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,24 +17,19 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -/* Default stack size. */ -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +#ifndef _HURD_XATTR_H +#define _HURD_XATTR_H 1 -/* Required stack pointer alignment at beginning. */ -#define STACK_ALIGN 16 +#include <sys/xattr.h> /* This defines the XATTR_* flags. */ -/* Minimal stack size after allocating thread descriptor and guard size. */ -#define MINIMAL_REST_STACK 2048 +/* These are the internal versions of getxattr/setxattr/listxattr. */ +extern error_t _hurd_xattr_get (io_t port, const char *name, + void *value, size_t *size); +extern error_t _hurd_xattr_set (io_t port, const char *name, + const void *value, size_t size, int flags); +extern error_t _hurd_xattr_remove (io_t port, const char *name); +extern error_t _hurd_xattr_list (io_t port, void *buffer, size_t *size); -/* Alignment requirement for TCB. */ -#define TCB_ALIGNMENT 16 -/* Location of current stack frame. */ -#define CURRENT_STACK_FRAME __builtin_frame_address (0) - - -/* XXX Until we have a better place keep the definitions here. */ - -#define __exit_thread_inline(val) \ - INLINE_SYSCALL (exit, 1, (val)) +#endif /* hurd/xattr.h */ diff --git a/hurd/xattr.c b/hurd/xattr.c new file mode 100644 index 0000000000..cf3e22d982 --- /dev/null +++ b/hurd/xattr.c @@ -0,0 +1,201 @@ +/* Support for *xattr interfaces on GNU/Hurd. + Copyright (C) 2006 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 <hurd.h> +#include <hurd/xattr.h> +#include <string.h> +#include <sys/mman.h> + +/* Right now we support only a fixed set of xattr names for Hurd features. + There are no RPC interfaces for free-form xattr names and values. + + Name Value encoding + ---- ----- -------- + gnu.author empty if st_author==st_uid + uid_t giving st_author value + gnu.translator empty if no passive translator + translator and arguments: "/hurd/foo\0arg1\0arg2\0" +*/ + +error_t +_hurd_xattr_get (io_t port, const char *name, void *value, size_t *size) +{ + if (strncmp (name, "gnu.", 4)) + return EOPNOTSUPP; + name += 4; + + if (!strcmp (name, "author")) + { + struct stat64 st; + error_t err = __io_stat (port, &st); + if (err) + return err; + if (st.st_author == st.st_uid) + *size = 0; + else if (value) + { + if (*size < sizeof st.st_author) + return ERANGE; + memcpy (value, &st.st_author, sizeof st.st_author); + } + *size = sizeof st.st_author; + return 0; + } + + if (!strcmp (name, "translator")) + { + char *buf = value; + size_t bufsz = value ? *size : 0; + error_t err = __file_get_translator (port, &buf, &bufsz); + if (err) + return err; + if (value != NULL && *size < bufsz) + { + if (buf != value) + munmap (buf, bufsz); + return -ERANGE; + } + if (buf != value && bufsz > 0) + { + if (value != NULL) + memcpy (value, buf, bufsz); + munmap (buf, bufsz); + } + *size = bufsz; + return 0; + } + + return EOPNOTSUPP; +} + +error_t +_hurd_xattr_set (io_t port, const char *name, const void *value, size_t size, + int flags) +{ + if (strncmp (name, "gnu.", 4)) + return EOPNOTSUPP; + name += 4; + + if (!strcmp (name, "author")) + switch (size) + { + default: + return EINVAL; + case 0: /* "Clear" author by setting to st_uid. */ + { + struct stat64 st; + error_t err = __io_stat (port, &st); + if (err) + return err; + if (st.st_author == st.st_uid) + { + /* Nothing to do. */ + if (flags & XATTR_REPLACE) + return ENODATA; + return 0; + } + if (flags & XATTR_CREATE) + return EEXIST; + return __file_chauthor (port, st.st_uid); + } + case sizeof (uid_t): /* Set the author. */ + { + uid_t id; + memcpy (&id, value, sizeof id); + if (flags & (XATTR_CREATE|XATTR_REPLACE)) + { + struct stat64 st; + error_t err = __io_stat (port, &st); + if (err) + return err; + if (st.st_author == st.st_uid) + { + if (flags & XATTR_REPLACE) + return ENODATA; + } + else if (flags & XATTR_CREATE) + return EEXIST; + if (st.st_author == id) + /* Nothing to do. */ + return 0; + } + return __file_chauthor (port, id); + } + } + + if (!strcmp (name, "translator")) + { + if (flags & XATTR_REPLACE) + { + /* Must make sure it's already there. */ + char *buf = NULL; + size_t bufsz = 0; + error_t err = __file_get_translator (port, &buf, &bufsz); + if (err) + return err; + if (bufsz > 0) + { + munmap (buf, bufsz); + return ENODATA; + } + } + return __file_set_translator (port, + FS_TRANS_SET | ((flags & XATTR_CREATE) + ? FS_TRANS_EXCL : 0), 0, 0, + value, size, + MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND); + } + + return EOPNOTSUPP; +} + +error_t +_hurd_xattr_remove (io_t port, const char *name) +{ + return _hurd_xattr_set (port, name, NULL, 0, XATTR_REPLACE); +} + +error_t +_hurd_xattr_list (io_t port, void *buffer, size_t *size) +{ + size_t total = 0; + char *bufp = buffer; + inline void add (const char *name, size_t len) + { + total += len; + if (bufp != NULL && total <= *size) + bufp = __mempcpy (bufp, name, len); + } +#define add(s) add (s, sizeof s) + + struct stat64 st; + error_t err = __io_stat (port, &st); + if (err) + return err; + + if (st.st_author != st.st_uid) + add ("gnu.author"); + if (st.st_mode & S_IPTRANS) + add ("gnu.translator"); + + if (buffer != NULL && total > *size) + return ERANGE; + *size = total; + return 0; +} diff --git a/include/fcntl.h b/include/fcntl.h index f00881449d..e23af1c3d3 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -17,6 +17,13 @@ extern int __open (__const char *__file, int __oflag, ...); libc_hidden_proto (__open) extern int __fcntl (int __fd, int __cmd, ...); libc_hidden_proto (__fcntl) +extern int __openat (int __fd, __const char *__file, int __oflag, ...) + __nonnull ((2)); +libc_hidden_proto (__openat) +extern int __openat64 (int __fd, __const char *__file, int __oflag, ...) + __nonnull ((2)); +libc_hidden_proto (__openat64) + /* Helper functions for the various *at functions. For Linux. */ extern void __atfct_seterrno (int errval, int fd, const char *buf) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 8ee940719e..da46f5e804 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -1,6 +1,7 @@ /* Support macros for making weak and strong aliases for symbols, and for using symbol sets and linker warnings with GNU ld. - Copyright (C) 1995-1998,2000-2003,2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-1998,2000-2003,2004,2005,2006 + 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 @@ -502,7 +503,7 @@ for linking") } libc_hidden_weak (foo) - Simularly for global data. If references to foo within libc.so should + Similarly for global data. If references to foo within libc.so should always go to foo defined in libc.so, then in include/foo.h you add: libc_hidden_proto (foo) @@ -517,7 +518,7 @@ for linking") int foo = INITIAL_FOO_VALUE; libc_hidden_data_weak (foo) - If foo is normally just an alias (strong or weak) of some other function, + If foo is normally just an alias (strong or weak) to some other function, you should use the normal strong_alias first, then add libc_hidden_def or libc_hidden_weak: diff --git a/include/link.h b/include/link.h index 0c35264096..3079ae8739 100644 --- a/include/link.h +++ b/include/link.h @@ -1,6 +1,6 @@ /* Data structure for communication from the run-time dynamic linker for loaded ELF shared objects. - Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2002,2003,2004,2005,2006 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 @@ -18,67 +18,32 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef _LINK_H -#define _LINK_H 1 +#ifndef _PRIVATE_LINK_H +#define _PRIVATE_LINK_H 1 -#include <elf.h> -#include <dlfcn.h> -#include <stddef.h> -#include <sys/types.h> +#ifdef _LINK_H +# error this should be impossible +#endif + +/* Get most of the contents from the public header, but we define a + different `struct link_map' type for private use. The la_objopen + prototype uses the type, so we have to declare it separately. */ +#define link_map link_map_public +#define la_objopen la_objopen_wrongproto +#include <elf/link.h> +#undef link_map +#undef la_objopen + +struct link_map; +extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid, + uintptr_t *__cookie); -/* We use this macro to refer to ELF types independent of the native wordsize. - `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */ -#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type) -#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t) -#define _ElfW_1(e,w,t) e##w##t -#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */ -#include <bits/link.h> +#include <stddef.h> #include <bits/linkmap.h> #include <dl-lookupcfg.h> #include <tls.h> /* Defines USE_TLS. */ -/* Rendezvous structure used by the run-time dynamic linker to communicate - details of shared object loading to the debugger. If the executable's - dynamic section has a DT_DEBUG element, the run-time linker sets that - element's value to the address where this structure can be found. */ - -struct r_debug - { - int r_version; /* Version number for this protocol. */ - - struct link_map *r_map; /* Head of the chain of loaded objects. */ - - /* This is the address of a function internal to the run-time linker, - that will always be called when the linker begins to map in a - library or unmap it, and again when the mapping change is complete. - The debugger can set a breakpoint at this address if it wants to - notice shared object mapping changes. */ - ElfW(Addr) r_brk; - enum - { - /* This state value describes the mapping change taking place when - the `r_brk' address is called. */ - RT_CONSISTENT, /* Mapping change is complete. */ - RT_ADD, /* Beginning to add a new object. */ - RT_DELETE /* Beginning to remove an object mapping. */ - } r_state; - - ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */ - }; - -/* This is the instance of that structure used by the dynamic linker. */ -extern struct r_debug _r_debug; - -/* This symbol refers to the "dynamic structure" in the `.dynamic' section - of whatever module refers to `_DYNAMIC'. So, to find its own - `struct r_debug', a program could do: - for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn) - if (dyn->d_tag == DT_DEBUG) - r_debug = (struct r_debug *) dyn->d_un.d_ptr; - */ -extern ElfW(Dyn) _DYNAMIC[]; - /* Some internal data structures of the dynamic linker used in the linker map. We only provide forward declarations. */ @@ -316,45 +281,6 @@ struct link_map } l_audit[0]; }; -/* Version numbers for la_version handshake interface. */ -#define LAV_CURRENT 1 - -/* Activity types signaled through la_activity. */ -enum - { - LA_ACT_CONSISTENT, - LA_ACT_ADD, - LA_ACT_DELETE - }; - -/* Values representing origin of name for dynamic loading. */ -enum - { - LA_SER_ORIG = 0x01, /* Original name. */ - LA_SER_LIBPATH = 0x02, /* Directory from LD_LIBRARY_PATH. */ - LA_SER_RUNPATH = 0x04, /* Directory from RPATH/RUNPATH. */ - LA_SER_CONFIG = 0x08, /* Found through ldconfig. */ - LA_SER_DEFAULT = 0x40, /* Default directory. */ - LA_SER_SECURE = 0x80 /* Unused. */ - }; - -/* Values for la_objopen return value. */ -enum - { - LA_FLG_BINDTO = 0x01, /* Audit symbols bound to this object. */ - LA_FLG_BINDFROM = 0x02 /* Audit symbols bound from this object. */ - }; - -/* Values for la_symbind flags parameter. */ -enum - { - LA_SYMB_NOPLTENTER = 0x01, /* la_pltenter will not be called. */ - LA_SYMB_NOPLTEXIT = 0x02, /* la_pltexit will not be called. */ - LA_SYMB_STRUCTCALL = 0x04, /* Return value is a structure. */ - LA_SYMB_DLSYM = 0x08, /* Binding due to dlsym call. */ - LA_SYMB_ALTVALUE = 0x10 /* Value has been changed by a previous - la_symbind call. */ - }; #if __ELF_NATIVE_CLASS == 32 # define symbind symbind32 @@ -364,22 +290,8 @@ enum # error "__ELF_NATIVE_CLASS must be defined" #endif -struct dl_phdr_info - { - ElfW(Addr) dlpi_addr; - const char *dlpi_name; - const ElfW(Phdr) *dlpi_phdr; - ElfW(Half) dlpi_phnum; - - unsigned long long int dlpi_adds; - unsigned long long int dlpi_subs; - }; - -extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, - size_t size, void *data), - void *data); extern int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data); -#endif /* link.h */ +#endif /* include/link.h */ diff --git a/include/unistd.h b/include/unistd.h index f4d6cad7b6..670cb324ae 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -96,10 +96,10 @@ extern int __setgid (__gid_t __gid); extern int __setpgid (__pid_t __pid, __pid_t __pgid); libc_hidden_proto (__setpgid) extern int __setregid (__gid_t __rgid, __gid_t __egid); -extern int __getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); -extern int __getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); -extern int __setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); -extern int __setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); +extern int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid); +extern int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid); +extern int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid); +extern int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid); libc_hidden_proto (__getresuid) libc_hidden_proto (__getresgid) libc_hidden_proto (__setresuid) diff --git a/io/fcntl.h b/io/fcntl.h index e50afbbfd1..72a944b3d4 100644 --- a/io/fcntl.h +++ b/io/fcntl.h @@ -58,11 +58,12 @@ __BEGIN_DECLS #ifdef __USE_ATFILE # define AT_FDCWD -100 /* Special value used to indicate - openat should use the current - working directory. */ + the *at functions should use the + current working directory. */ # define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ # define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ +# define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ # define AT_EACCESS 0x200 /* Test access permitted for effective IDs, not real IDs. */ #endif diff --git a/io/linkat.c b/io/linkat.c index 6420d50334..9afcf61a3c 100644 --- a/io/linkat.c +++ b/io/linkat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006 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 @@ -24,11 +24,12 @@ /* Make a link to FROM relative to FROMFD called TO relative to TOFD. */ int -linkat (fromfd, from, tofd, to) +linkat (fromfd, from, tofd, to, flags) int fromfd; const char *from; int tofd; const char *to; + int flags; { if (from == NULL || to == NULL) { diff --git a/io/openat.c b/io/openat.c index f3f699ca23..c65ad19c7a 100644 --- a/io/openat.c +++ b/io/openat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ the directory associated with FD. If OFLAG includes O_CREAT, a third argument is the file protection. */ int -openat (fd, file, oflag) +__openat (fd, file, oflag) int fd; const char *file; int oflag; @@ -64,6 +64,8 @@ openat (fd, file, oflag) __set_errno (ENOSYS); return -1; } +libc_hidden_def (__openat) +weak_alias (__openat, openat) stub_warning (openat) #include <stub-tag.h> diff --git a/io/openat64.c b/io/openat64.c index 87952d38d6..830701a949 100644 --- a/io/openat64.c +++ b/io/openat64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ the directory associated with FD. If OFLAG includes O_CREAT, a third argument is the file protection. */ int -openat64 (fd, file, oflag) +__openat64 (fd, file, oflag) int fd; const char *file; int oflag; @@ -64,6 +64,8 @@ openat64 (fd, file, oflag) __set_errno (ENOSYS); return -1; } +libc_hidden_def (__openat64) +weak_alias (__openat64, openat64) stub_warning (openat64) #include <stub-tag.h> diff --git a/io/tst-linkat.c b/io/tst-linkat.c index a77ceb1db4..d63c982751 100644 --- a/io/tst-linkat.c +++ b/io/tst-linkat.c @@ -105,7 +105,7 @@ do_test (void) close (fd); - if (linkat (dir_fd, "some-file", dir_fd, "another-file") != 0) + if (linkat (dir_fd, "some-file", dir_fd, "another-file", 0) != 0) { puts ("symlinkat failed"); return 1; diff --git a/libidn/ChangeLog b/libidn/ChangeLog index f9303743fc..67d5de1e9e 100644 --- a/libidn/ChangeLog +++ b/libidn/ChangeLog @@ -1,3 +1,15 @@ +2006-02-27 Roland McGrath <roland@redhat.com> + + * Makefile: Use $(..) in place of ../. + * configure.in (libc_add_on_canonical, libc_add_on_subdirs): Set them. + * configure: Regenerated. + +2006-02-25 Roland McGrath <roland@redhat.com> + + * configure.in: New file. + * configure: Replaced with generated file. + * sysdeps/unix/configure: File removed. + 2005-03-08 Paul Eggert <eggert@cs.ucla.edu> * iconvme.c (SIZE_MAX): New macro, if not already defined. diff --git a/libidn/Makefile b/libidn/Makefile index 3d2ef5ef9b..3a4d1b3422 100644 --- a/libidn/Makefile +++ b/libidn/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 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 @@ -31,10 +31,10 @@ libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \ iconvme -include ../Makeconfig +include $(..)Makeconfig libcidn-inhibit-o = $(filter-out .os,$(object-suffixes)) -include ../Rules +include $(..)Rules $(objpfx)libcidn.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a diff --git a/libidn/configure b/libidn/configure index 53d0dcd67e..365e747df2 100644 --- a/libidn/configure +++ b/libidn/configure @@ -1,3 +1,10 @@ -# This is only to keep the GNU C library configure mechanism happy. -# This is a shell script fragment sourced by the main configure script. -# We have nothing we need to add here. +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + +libc_add_on_canonical= +libc_add_on_subdirs=. + +# Get this defined in config.h for main source code to test. +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBIDN 1 +_ACEOF + diff --git a/libidn/configure.in b/libidn/configure.in new file mode 100644 index 0000000000..38b9ad7fac --- /dev/null +++ b/libidn/configure.in @@ -0,0 +1,8 @@ +dnl glibc configure fragment for libidn add-on +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. + +libc_add_on_canonical= +libc_add_on_subdirs=. + +# Get this defined in config.h for main source code to test. +AC_DEFINE([HAVE_LIBIDN]) diff --git a/libidn/sysdeps/unix/configure b/libidn/sysdeps/unix/configure deleted file mode 100755 index 2d9fac30e5..0000000000 --- a/libidn/sysdeps/unix/configure +++ /dev/null @@ -1,2 +0,0 @@ -# Signal that libidn is available. -libc_cv_idn=yes diff --git a/libio/genops.c b/libio/genops.c index 030343e7aa..5f223524a0 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -34,6 +34,9 @@ #endif #include <string.h> #include <stdbool.h> +#ifdef _LIBC +#include <sched.h> +#endif #ifdef _IO_MTSAFE_IO static _IO_lock_t list_all_lock = _IO_lock_initializer; diff --git a/manual/llio.texi b/manual/llio.texi index 863b3b4316..1d088d8ee2 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -368,6 +368,11 @@ sending it a @code{SIGTTIN} signal isn't working. This might happen if the signal is being blocked or ignored, or because the process group is orphaned. @xref{Job Control}, for more information about job control, and @ref{Signal Handling}, for information about signals. + +@item EINVAL +In some systems, when reading from a character or block device, position +and size offsets must be aligned to a particular block size. This error +indicates that the offsets were not properly aligned. @end table Please note that there is no function named @code{read64}. This is not @@ -515,6 +520,11 @@ The device containing the file is full. This error is returned when you try to write to a pipe or FIFO that isn't open for reading by any process. When this happens, a @code{SIGPIPE} signal is also sent to the process; see @ref{Signal Handling}. + +@item EINVAL +In some systems, when writing to a character or block device, position +and size offsets must be aligned to a particular block size. This error +indicates that the offsets were not properly aligned. @end table Unless you have arranged to prevent @code{EINTR} failures, you should diff --git a/manual/memory.texi b/manual/memory.texi index 0f28806a22..91b9d84eb2 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -1968,7 +1968,8 @@ obstack_next_free (@var{obstack-ptr}) - obstack_base (@var{obstack-ptr}) Each obstack has an @dfn{alignment boundary}; each object allocated in the obstack automatically starts on an address that is a multiple of the -specified boundary. By default, this boundary is 4 bytes. +specified boundary. By default, this boundary is aligned so that +the object can hold any type of data. To access an obstack's alignment boundary, use the macro @code{obstack_alignment_mask}, whose function prototype looks like @@ -1980,7 +1981,9 @@ this: The value is a bit mask; a bit that is 1 indicates that the corresponding bit in the address of an object should be 0. The mask value should be one less than a power of 2; the effect is that all object addresses are -multiples of that power of 2. The default value of the mask is 3, so that +multiples of that power of 2. The default value of the mask is a value +that allows aligned objects to hold any type of data: for example, if +its value is 3, any type of data can be stored at locations whose addresses are multiples of 4. A mask value of 0 means an object can start on any multiple of 1 (that is, no alignment is required). diff --git a/math/Makefile b/math/Makefile index b45283d8fc..1ab1b13b07 100644 --- a/math/Makefile +++ b/math/Makefile @@ -108,7 +108,7 @@ generated += $(libm-tests-generated) libm-test.stmp # This is needed for dependencies before-compile += $(objpfx)libm-test.c -ulps-file = $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps))) +ulps-file = $(firstword $(wildcard $(sysdirs:%=%/libm-test-ulps))) $(addprefix $(objpfx), $(libm-tests-generated)): $(objpfx)libm-test.stmp diff --git a/misc/Makefile b/misc/Makefile index 7d60baa7d6..63b6d413b3 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -30,7 +30,8 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \ sys/queue.h sysexits.h syscall.h sys/syscall.h sys/swap.h \ sys/select.h ustat.h sys/ustat.h bits/ustat.h sys/sysinfo.h \ regexp.h bits/select.h bits/mman.h sys/xattr.h \ - syslog.h sys/syslog.h bits/syslog.h bits/syslog-ldbl.h + syslog.h sys/syslog.h \ + bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h routines := brk sbrk sstk ioctl \ readv writev \ diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h index 0bc5b8d677..4ed57c2787 100644 --- a/misc/sys/syslog.h +++ b/misc/sys/syslog.h @@ -36,8 +36,8 @@ #define __need___va_list #include <stdarg.h> - -#define _PATH_LOG "/dev/log" +/* This file defines _PATH_LOG. */ +#include <bits/syslog-path.h> /* * priorities/facilities are encoded into a single 32-bit quantity, where the diff --git a/nis/ypclnt.c b/nis/ypclnt.c index 66095667c6..78adf6aeec 100644 --- a/nis/ypclnt.c +++ b/nis/ypclnt.c @@ -819,58 +819,58 @@ yperr_string (const int error) switch (error) { case YPERR_SUCCESS: - str = "Success"; + str = N_("Success"); break; case YPERR_BADARGS: - str = "Request arguments bad"; + str = N_("Request arguments bad"); break; case YPERR_RPC: - str = "RPC failure on NIS operation"; + str = N_("RPC failure on NIS operation"); break; case YPERR_DOMAIN: - str = "Can't bind to server which serves this domain"; + str = N_("Can't bind to server which serves this domain"); break; case YPERR_MAP: - str = "No such map in server's domain"; + str = N_("No such map in server's domain"); break; case YPERR_KEY: - str = "No such key in map"; + str = N_("No such key in map"); break; case YPERR_YPERR: - str = "Internal NIS error"; + str = N_("Internal NIS error"); break; case YPERR_RESRC: - str = "Local resource allocation failure"; + str = N_("Local resource allocation failure"); break; case YPERR_NOMORE: - str = "No more records in map database"; + str = N_("No more records in map database"); break; case YPERR_PMAP: - str = "Can't communicate with portmapper"; + str = N_("Can't communicate with portmapper"); break; case YPERR_YPBIND: - str = "Can't communicate with ypbind"; + str = N_("Can't communicate with ypbind"); break; case YPERR_YPSERV: - str = "Can't communicate with ypserv"; + str = N_("Can't communicate with ypserv"); break; case YPERR_NODOM: - str = "Local domain name not set"; + str = N_("Local domain name not set"); break; case YPERR_BADDB: - str = "NIS map database is bad"; + str = N_("NIS map database is bad"); break; case YPERR_VERS: - str = "NIS client/server version mismatch - can't supply service"; + str = N_("NIS client/server version mismatch - can't supply service"); break; case YPERR_ACCESS: - str = "Permission denied"; + str = N_("Permission denied"); break; case YPERR_BUSY: - str = "Database is busy"; + str = N_("Database is busy"); break; default: - str = "Unknown NIS error code"; + str = N_("Unknown NIS error code"); break; } return _(str); @@ -907,19 +907,19 @@ ypbinderr_string (const int error) switch (error) { case 0: - str = "Success"; + str = N_("Success"); break; case YPBIND_ERR_ERR: - str = "Internal ypbind error"; + str = N_("Internal ypbind error"); break; case YPBIND_ERR_NOSERV: - str = "Domain not bound"; + str = N_("Domain not bound"); break; case YPBIND_ERR_RESC: - str = "System resource allocation failure"; + str = N_("System resource allocation failure"); break; default: - str = "Unknown ypbind error"; + str = N_("Unknown ypbind error"); break; } return _(str); diff --git a/nptl/ChangeLog b/nptl/ChangeLog index bb29a14906..3c65aab301 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,98 @@ +2006-02-28 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S> + instead of <clone.S>. + +2006-02-27 Jakub Jelinek <jakub@redhat.com> + + * Makefile (libpthread-routines): Add + pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling + and pthread_mutex_[sg]etprioceiling. + * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol, + pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling, + pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and + pthread_mutex_setprioceiling. + * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, + PTHREAD_PRIO_PROTECT): New enum values. + (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol, + pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling, + pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New + prototypes. + * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP, + PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values. + (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK): + Define. + (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK, + PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT, + PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define. + (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK + and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK. + * pthread_mutex_init.c (__pthread_mutex_init): For the time being + return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT + protocol mutexes. + * pthread_mutex_getprioceiling.c: New file. + * pthread_mutex_setprioceiling.c: New file. + * pthread_mutexattr_getprioceiling.c: New file. + * pthread_mutexattr_setprioceiling.c: New file. + * pthread_mutexattr_getprotocol.c: New file. + * pthread_mutexattr_setprotocol.c: New file. + +2006-02-27 Daniel Jacobowitz <dan@codesourcery.com> + + * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>. + +2006-02-27 Roland McGrath <roland@redhat.com> + + * sysdeps/pthread/Subdirs: List nptl here too. + * configure (libc_add_on_canonical): New variable. + + * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next. + + * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of + self to get main source tree's file. + * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise. + * sysdeps/unix/sysv/linux/i386/clone.S: Likewise. + * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise. + * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise. + * sysdeps/unix/sysv/linux/sh/clone.S: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise. + + * Makefile: Use $(sysdirs) in vpath directive. + + * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed. + (CPPFLAGS-timer_routines.c): Likewise. + + * Makeconfig (includes): Variable removed. + +2006-02-26 Roland McGrath <roland@redhat.com> + + * sysdeps/generic/pt-raise.c: Moved to ... + * pt-raise.c: ... here. + * sysdeps/generic/lowlevellock.h: Moved to ... + * lowlevellock.h: ... here. + +2006-02-23 Roland McGrath <roland@redhat.com> + + * descr.h (struct pthread): Add final member `end_padding'. + (PTHREAD_STRUCT_END_PADDING): Use it. + +2006-02-20 Roland McGrath <roland@redhat.com> + + * sysdeps/mips: Directory removed, saved in ports repository. + * sysdeps/unix/sysv/linux/mips: Likewise. + +2006-02-18 Ulrich Drepper <drepper@redhat.com> + + * tst-robust1.c: Add second mutex to check that the mutex list is + handled correctly. + 2006-02-17 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead, @@ -48,7 +143,7 @@ 2006-02-15 Ulrich Drepper <drepper@redhat.com> - * pthreadp.h: Define PTHREAD_MUTEX_INCONSISTENT instead of + * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of PTHREAD_MUTEX_OWNERDEAD. (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256. Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK. @@ -85,6 +180,7 @@ but the owner for all robust mutex types. * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define __pthread_list_t and __pthread_slist_t. Use them in pthread_mutex_t. + * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise. * sysdeps/pthread/pthread.h: Adjust mutex initializers. * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel, diff --git a/nptl/Makeconfig b/nptl/Makeconfig index 681d76f61f..54e2f65b01 100644 --- a/nptl/Makeconfig +++ b/nptl/Makeconfig @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2005,2006 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -28,7 +28,3 @@ static-thread-library = $(common-objpfx)nptl/libpthread.a bounded-thread-library = $(common-objpfx)nptl/libpthread_b.a rpath-dirs += nptl - -ifneq ($(subdir),nptl) -includes += -I$(..)nptl -endif diff --git a/nptl/Makefile b/nptl/Makefile index 60203cd114..31b5ace92e 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -118,7 +118,12 @@ libpthread-routines = init vars events version \ pthread_attr_getaffinity pthread_attr_setaffinity \ pthread_mutexattr_getrobust pthread_mutexattr_setrobust \ pthread_mutex_consistent \ - cleanup_routine unwind-forcedunwind + cleanup_routine unwind-forcedunwind \ + pthread_mutexattr_getprotocol \ + pthread_mutexattr_setprotocol \ + pthread_mutexattr_getprioceiling \ + pthread_mutexattr_setprioceiling \ + pthread_mutex_getprioceiling pthread_mutex_setprioceiling # pthread_setuid pthread_seteuid pthread_setreuid \ # pthread_setresuid \ # pthread_setgid pthread_setegid pthread_setregid \ @@ -532,7 +537,7 @@ $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a endif ifeq ($(build-shared),yes) -vpath pt-initfini.c $(full_config_sysdirs) +vpath pt-initfini.c $(sysdirs) $(objpfx)pt-initfini.s: pt-initfini.c $(compile.c) -S $(CFLAGS-pt-initfini.s) -finhibit-size-directive \ diff --git a/nptl/Versions b/nptl/Versions index 2b4dd01ab5..54b9b9c6a5 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -235,6 +235,9 @@ libpthread { GLIBC_2.4 { pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust_np; pthread_mutex_consistent_np; + pthread_mutexattr_getprotocol; pthread_mutexattr_setprotocol; + pthread_mutexattr_getprioceiling; pthread_mutexattr_setprioceiling; + pthread_mutex_getprioceiling; pthread_mutex_setprioceiling; }; GLIBC_PRIVATE { diff --git a/nptl/configure b/nptl/configure index 3ad635f48d..1ce3caec6e 100644 --- a/nptl/configure +++ b/nptl/configure @@ -1,6 +1,5 @@ -# This is only to keep the GNU C library configure mechanism happy. # This is a shell script fragment sourced by the main configure script. -# We have nothing we need to add here. -# -# Perhaps some day we will need a real configuration script for different -# kernel versions or so. +# We're obliged to give here the canonical name that will be used to +# as a subdirectory to search for in other add-ons' sysdeps trees. + +libc_add_on_canonical=nptl diff --git a/nptl/descr.h b/nptl/descr.h index d5491c1355..80251b920b 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -305,12 +305,11 @@ struct pthread /* Resolver state. */ struct __res_state res; - /* If you add fields after the res field above, please adjust - the following macro. */ -#define PTHREAD_STRUCT_END_PADDING \ - (sizeof (struct pthread) - offsetof (struct pthread, res) \ - - sizeof (((struct pthread *) 0)->res)) + /* This member must be last. */ + char end_padding[]; +#define PTHREAD_STRUCT_END_PADDING \ + (sizeof (struct pthread) - offsetof (struct pthread, end_padding)) } __attribute ((aligned (TCB_ALIGNMENT))); diff --git a/nptl/sysdeps/generic/lowlevellock.h b/nptl/lowlevellock.h index 7f95daadad..338da39990 100644 --- a/nptl/sysdeps/generic/lowlevellock.h +++ b/nptl/lowlevellock.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Low level locking macros used in NPTL implementation. Stub version. + Copyright (C) 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/sysdeps/generic/pt-raise.c b/nptl/pt-raise.c index 59d9590e6e..a72cf85502 100644 --- a/nptl/sysdeps/generic/pt-raise.c +++ b/nptl/pt-raise.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* ISO C raise function for libpthread. + Copyright (C) 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 77d8f5ad24..a4d6d1a1ae 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -66,15 +66,24 @@ enum PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP - = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_ADAPTIVE_NP + = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_ADAPTIVE_NP, + PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP = 32, + PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP = 64 }; +#define PTHREAD_MUTEX_PRIO_CEILING_SHIFT 16 +#define PTHREAD_MUTEX_PRIO_CEILING_MASK 0x00ff0000 /* Flags in mutex attr. */ -#define PTHREAD_MUTEXATTR_FLAG_ROBUST 0x40000000 -#define PTHREAD_MUTEXATTR_FLAG_PSHARED 0x80000000 +#define PTHREAD_MUTEXATTR_PROTOCOL_SHIFT 28 +#define PTHREAD_MUTEXATTR_PROTOCOL_MASK 0x30000000 +#define PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT 16 +#define PTHREAD_MUTEXATTR_PRIO_CEILING_MASK 0x00ff0000 +#define PTHREAD_MUTEXATTR_FLAG_ROBUST 0x40000000 +#define PTHREAD_MUTEXATTR_FLAG_PSHARED 0x80000000 #define PTHREAD_MUTEXATTR_FLAG_BITS \ - (PTHREAD_MUTEXATTR_FLAG_ROBUST | PTHREAD_MUTEXATTR_FLAG_PSHARED) + (PTHREAD_MUTEXATTR_FLAG_ROBUST | PTHREAD_MUTEXATTR_FLAG_PSHARED \ + | PTHREAD_MUTEXATTR_PROTOCOL_MASK | PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) /* Bits used in robust mutex implementation. */ diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/nptl/pthread_mutex_getprioceiling.c index 3490c79bdc..4d1bc28431 100644 --- a/sysdeps/m68k/jmpbuf-unwind.h +++ b/nptl/pthread_mutex_getprioceiling.c @@ -1,6 +1,7 @@ -/* Examine __jmp_buf for unwinding frames. m68k version. +/* Get current priority ceiling of pthread_mutex_t. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,16 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <setjmp.h> +#include <pthreadP.h> -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)->__sp)) + +int +pthread_mutex_getprioceiling (mutex, prioceiling) + const pthread_mutex_t *mutex; + int *prioceiling; +{ + *prioceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK) + >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT; + + return 0; +} diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c index 17d1c99575..f984d90ae4 100644 --- a/nptl/pthread_mutex_init.c +++ b/nptl/pthread_mutex_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -46,6 +46,11 @@ __pthread_mutex_init (mutex, mutexattr) if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0 && (imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0) return ENOTSUP; + // XXX For now we don't support priority inherited or priority protected + // XXX mutexes. + if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_PROTOCOL_MASK) + != (PTHREAD_PRIO_NONE << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT)) + return ENOTSUP; /* Clear the whole variable. */ memset (mutex, '\0', __SIZEOF_PTHREAD_MUTEX_T); @@ -54,6 +59,27 @@ __pthread_mutex_init (mutex, mutexattr) mutex->__data.__kind = imutexattr->mutexkind & ~PTHREAD_MUTEXATTR_FLAG_BITS; if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0) mutex->__data.__kind |= PTHREAD_MUTEX_ROBUST_PRIVATE_NP; + switch ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_PROTOCOL_MASK) + >> PTHREAD_MUTEXATTR_PROTOCOL_SHIFT) + { + case PTHREAD_PRIO_INHERIT: + mutex->__data.__kind |= PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP; + break; + case PTHREAD_PRIO_PROTECT: + mutex->__data.__kind |= PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP; + if (PTHREAD_MUTEX_PRIO_CEILING_MASK + == PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) + mutex->__data.__kind |= (imutexattr->mutexkind + & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK); + else + mutex->__data.__kind |= ((imutexattr->mutexkind + & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) + >> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT) + << PTHREAD_MUTEX_PRIO_CEILING_SHIFT; + break; + default: + break; + } /* Default values: mutex not used yet. */ // mutex->__count = 0; already done by memset diff --git a/nptl/pthread_mutex_setprioceiling.c b/nptl/pthread_mutex_setprioceiling.c new file mode 100644 index 0000000000..999b635ac1 --- /dev/null +++ b/nptl/pthread_mutex_setprioceiling.c @@ -0,0 +1,55 @@ +/* Set current priority ceiling of pthread_mutex_t. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. + + 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 <errno.h> +#include <pthreadP.h> + + +int +pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling) + pthread_mutex_t *mutex; + int prioceiling; + int *old_ceiling; +{ + /* The low bits of __kind aren't ever changed after pthread_mutex_init, + so we don't need a lock yet. */ + if ((mutex->__data.__kind & PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP) == 0) + return EINVAL; + + if (prioceiling < 0 || __builtin_expect (prioceiling > 255, 0)) + return EINVAL; + + /* XXX This needs to lock with TID, but shouldn't obey priority protect + protocol. */ + /* lll_xxx_mutex_lock (mutex->__data.__lock); */ + + if (old_ceiling != NULL) + *old_ceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK) + >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT; + + int newkind = (mutex->__data.__kind & ~PTHREAD_MUTEX_PRIO_CEILING_MASK); + mutex->__data.__kind = newkind + | (prioceiling << PTHREAD_MUTEX_PRIO_CEILING_SHIFT); + + /* XXX This needs to unlock the above special kind of lock. */ + /* lll_xxx_mutex_unlock (mutex->__data.__lock); */ + + return 0; +} diff --git a/nptl/pthread_mutexattr_getprioceiling.c b/nptl/pthread_mutexattr_getprioceiling.c new file mode 100644 index 0000000000..da1beabf46 --- /dev/null +++ b/nptl/pthread_mutexattr_getprioceiling.c @@ -0,0 +1,37 @@ +/* Get priority ceiling setting from pthread_mutexattr_t. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. + + 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 <pthreadP.h> + + +int +pthread_mutexattr_getprioceiling (attr, prioceiling) + const pthread_mutexattr_t *attr; + int *prioceiling; +{ + const struct pthread_mutexattr *iattr; + + iattr = (const struct pthread_mutexattr *) attr; + + *prioceiling = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) + >> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT); + + return 0; +} diff --git a/bare/console.c b/nptl/pthread_mutexattr_getprotocol.c index 326ebed4a1..0c28699c87 100644 --- a/bare/console.c +++ b/nptl/pthread_mutexattr_getprotocol.c @@ -1,7 +1,7 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. +/* Get priority protocol setting from pthread_mutexattr_t. + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), - On-Line Applications Research Corporation. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,25 +18,20 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <standalone.h> +#include <pthreadP.h> -/* This file is only required when a "bare" board is configured. */ - -/* These routines provide console IO routines for your embedded target. */ int -_Console_Putc (ch) - char ch; +pthread_mutexattr_getprotocol (attr, protocol) + const pthread_mutexattr_t *attr; + int *protocol; { - /* eat the character */ + const struct pthread_mutexattr *iattr; - return 0; -} + iattr = (const struct pthread_mutexattr *) attr; -int -_Console_Getc (poll) - int poll; -{ - /* boring user, never types anything */ - return -1; + *protocol = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PROTOCOL_MASK) + >> PTHREAD_MUTEXATTR_PROTOCOL_SHIFT); + + return 0; } diff --git a/nptl/pthread_mutexattr_setprioceiling.c b/nptl/pthread_mutexattr_setprioceiling.c new file mode 100644 index 0000000000..6c15b46833 --- /dev/null +++ b/nptl/pthread_mutexattr_setprioceiling.c @@ -0,0 +1,39 @@ +/* Change priority ceiling setting in pthread_mutexattr_t. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. + + 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 <errno.h> +#include <pthreadP.h> + + +int +pthread_mutexattr_setprioceiling (attr, prioceiling) + pthread_mutexattr_t *attr; + int prioceiling; +{ + if (prioceiling < 0 || __builtin_expect (prioceiling > 255, 0)) + return EINVAL; + + struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr; + + iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) + | (prioceiling << PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT)); + + return 0; +} diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/nptl/pthread_mutexattr_setprotocol.c index 6b2c92852d..191231244e 100644 --- a/sysdeps/unix/sysv/linux/m68k/brk.c +++ b/nptl/pthread_mutexattr_setprotocol.c @@ -1,6 +1,7 @@ -/* brk system call for Linux/m68k. - Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc. +/* Change priority protocol setting in pthread_mutexattr_t. + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,31 +19,23 @@ 02111-1307 USA. */ #include <errno.h> -#include <unistd.h> -#include <sysdep.h> +#include <pthreadP.h> -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) int -__brk (void *addr) +pthread_mutexattr_setprotocol (attr, protocol) + pthread_mutexattr_t *attr; + int protocol; { - void *newbrk; + if (protocol != PTHREAD_PRIO_NONE + && protocol != PTHREAD_PRIO_INHERIT + && __builtin_expect (protocol != PTHREAD_PRIO_PROTECT, 0)) + return EINVAL; - INTERNAL_SYSCALL_DECL (err); - newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); - __curbrk = newbrk; + struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr; - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } + iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_PROTOCOL_MASK) + | (protocol << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT)); return 0; } -weak_alias (__brk, brk) diff --git a/nptl/sysdeps/mips/Makefile b/nptl/sysdeps/mips/Makefile deleted file mode 100644 index d0c59a5091..0000000000 --- a/nptl/sysdeps/mips/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2005 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. - -ifeq ($(subdir),csu) -gen-as-const-headers += tcb-offsets.sym -endif - -ifeq ($(subdir),nptl) -libpthread-sysdep_routines += nptl-sysdep -endif diff --git a/nptl/sysdeps/mips/nptl-sysdep.S b/nptl/sysdeps/mips/nptl-sysdep.S deleted file mode 100644 index 3f5c2a364a..0000000000 --- a/nptl/sysdeps/mips/nptl-sysdep.S +++ /dev/null @@ -1,2 +0,0 @@ -/* Pull in __syscall_error. */ -#include <sysdep.S> diff --git a/nptl/sysdeps/mips/pthread_spin_lock.S b/nptl/sysdeps/mips/pthread_spin_lock.S deleted file mode 100644 index d5f2a72340..0000000000 --- a/nptl/sysdeps/mips/pthread_spin_lock.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2005 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 <sys/asm.h> -#include <sysdep.h> -#include <sgidefs.h> - -ENTRY (pthread_spin_lock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 -#endif -1: ll a2, 0(a0) - li a1, 1 - bnez a2, 1b - sc a1, 0(a0) - beqz a1, 1b - MIPS_SYNC - .set pop - li v0, 0 - ret -PSEUDO_END (pthread_spin_lock) diff --git a/nptl/sysdeps/mips/pthread_spin_trylock.S b/nptl/sysdeps/mips/pthread_spin_trylock.S deleted file mode 100644 index 9c6e740f0f..0000000000 --- a/nptl/sysdeps/mips/pthread_spin_trylock.S +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2005 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 <sys/asm.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#include <sgidefs.h> - -ENTRY (pthread_spin_trylock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 -#endif - ll a2, 0(a0) - li a1, 1 - bnez a2, 1f - sc a1, 0(a0) - beqz a1, 1f - MIPS_SYNC - .set pop - li v0, 0 - ret -1: li v0, EBUSY - ret -PSEUDO_END (pthread_spin_trylock) diff --git a/nptl/sysdeps/mips/tcb-offsets.sym b/nptl/sysdeps/mips/tcb-offsets.sym deleted file mode 100644 index e0e71dc430..0000000000 --- a/nptl/sysdeps/mips/tcb-offsets.sym +++ /dev/null @@ -1,11 +0,0 @@ -#include <sysdep.h> -#include <tls.h> - --- - --- Abuse tls.h macros to derive offsets relative to the thread register. -#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) - -MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) -TID_OFFSET thread_offsetof (tid) diff --git a/nptl/sysdeps/mips/tls.h b/nptl/sysdeps/mips/tls.h deleted file mode 100644 index 1cef161010..0000000000 --- a/nptl/sysdeps/mips/tls.h +++ /dev/null @@ -1,161 +0,0 @@ -/* Definition for thread-local data handling. NPTL/MIPS version. - Copyright (C) 2005 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 _TLS_H -#define _TLS_H 1 - -#include <dl-sysdep.h> - -#ifndef __ASSEMBLER__ -# include <stdbool.h> -# include <stddef.h> -# include <stdint.h> - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - -/* Note: rd must be $v1 to be ABI-conformant. */ -# define READ_THREAD_POINTER() \ - ({ void *__result; \ - asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \ - "rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \ - __result; }) - -#else /* __ASSEMBLER__ */ -# include <tcb-offsets.h> - -# define READ_THREAD_POINTER(rd) \ - .set push; \ - .set mips32r2; \ - rdhwr rd, $29; \ - .set pop -#endif /* __ASSEMBLER__ */ - - -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - -/* Signal that TLS support is available. */ -#define USE_TLS 1 - -#ifndef __ASSEMBLER__ - -/* Get system call information. */ -# include <sysdep.h> - -/* The TP points to the start of the thread blocks. */ -# define TLS_DTV_AT_TP 1 - -/* Get the thread descriptor definition. */ -# include <nptl/descr.h> - -typedef struct -{ - dtv_t *dtv; - void *private; -} tcbhead_t; - -/* This is the size of the initial TCB. Because our TCB is before the thread - pointer, we don't need this. */ -# define TLS_INIT_TCB_SIZE 0 - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread) - -/* This is the size of the TCB. Because our TCB is before the thread - pointer, we don't need this. */ -# define TLS_TCB_SIZE 0 - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (struct pthread) - -/* This is the size we need before TCB - actually, it includes the TCB. */ -# define TLS_PRE_TCB_SIZE \ - (sizeof (struct pthread) \ - + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) - -/* The thread pointer (in hardware register $29) points to the end of - the TCB + 0x7000, as for PowerPC. The pthread_descr structure is - immediately in front of the TCB. */ -# define TLS_TCB_OFFSET 0x7000 - -/* Install the dtv pointer. The pointer passed is to the element with - index -1 which contain the length. */ -# define INSTALL_DTV(tcbp, dtvp) \ - (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1) - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(dtv) \ - (THREAD_DTV() = (dtv)) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(tcbp) \ - (((tcbhead_t *) (tcbp))[-1].dtv) - -/* Code to initially initialize the thread pointer. This might need - special attention since 'errno' is not yet available and if the - operation can cause a failure 'errno' must not be touched. */ -# define TLS_INIT_TP(tcbp, secondcall) \ - ({ INTERNAL_SYSCALL_DECL (err); \ - long result_var; \ - result_var = INTERNAL_SYSCALL (set_thread_area, err, 1, \ - (char *) (tcbp) + TLS_TCB_OFFSET); \ - INTERNAL_SYSCALL_ERROR_P (result_var, err) \ - ? "unknown error" : NULL; }) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - (((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv) - -/* Return the thread descriptor for the current thread. */ -# define THREAD_SELF \ - ((struct pthread *) (READ_THREAD_POINTER () \ - - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)) - -/* Magic for libthread_db to know how to do THREAD_SELF. */ -# define DB_THREAD_SELF \ - CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) - -/* Access to data in the thread descriptor is easy. */ -# define THREAD_GETMEM(descr, member) \ - descr->member -# define THREAD_GETMEM_NC(descr, member, idx) \ - descr->member[idx] -# define THREAD_SETMEM(descr, member, value) \ - descr->member = (value) -# define THREAD_SETMEM_NC(descr, member, idx, value) \ - descr->member[idx] = (value) - -/* l_tls_offset == 0 is perfectly valid on MIPS, so we have to use some - different value to mean unset l_tls_offset. */ -# define NO_TLS_OFFSET -1 - -#endif /* __ASSEMBLER__ */ - -#endif /* tls.h */ diff --git a/nptl/sysdeps/pthread/Makefile b/nptl/sysdeps/pthread/Makefile index 207e10fad2..72550d74a7 100644 --- a/nptl/sysdeps/pthread/Makefile +++ b/nptl/sysdeps/pthread/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2004,2006 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -18,7 +18,6 @@ # 02111-1307 USA. ifeq ($(subdir),csu) -CFLAGS-libc-start.c += -I../nptl routines += unwind-resume shared-only-routines += unwind-resume CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables @@ -31,7 +30,6 @@ endif ifeq ($(subdir),rt) librt-sysdep_routines += timer_routines librt-cancellation rt-unwind-resume librt-shared-only-routines += rt-unwind-resume -CPPFLAGS-timer_routines.c = -I../nptl CFLAGS-librt-cancellation.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables diff --git a/nptl/sysdeps/pthread/Subdirs b/nptl/sysdeps/pthread/Subdirs index 4d1f4d876b..36266c1e69 100644 --- a/nptl/sysdeps/pthread/Subdirs +++ b/nptl/sysdeps/pthread/Subdirs @@ -1 +1,2 @@ +nptl nptl_db diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index f4935e07b4..e03c374c71 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -71,6 +71,17 @@ enum #endif +#ifdef __USE_UNIX98 +/* Mutex protocols. */ +enum +{ + PTHREAD_PRIO_NONE, + PTHREAD_PRIO_INHERIT, + PTHREAD_PRIO_PROTECT +}; +#endif + + /* Mutex initializers. */ #if __WORDSIZE == 64 # define PTHREAD_MUTEX_INITIALIZER \ @@ -711,6 +722,22 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW; +#ifdef __USE_UNIX98 +/* Get the priority ceiling of MUTEX. */ +extern int pthread_mutex_getprioceiling (__const pthread_mutex_t * + __restrict __mutex, + int *__restrict __prioceiling) + __THROW; + +/* Set the priority ceiling of MUTEX to PRIOCEILING, return old + priority ceiling value in *OLD_CEILING. */ +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int __prioceiling, + int *__restrict __old_ceiling) + __THROW; +#endif + + #ifdef __USE_GNU /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) __THROW; @@ -745,6 +772,26 @@ extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __THROW; + +/* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ +extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __protocol) __THROW; + +/* Set the mutex protocol attribute in *ATTR to PROTOCOL (either + PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ +extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, + int __protocol) __THROW; + +/* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ +extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __prioceiling) + __THROW; + +/* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ +extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, + int __prioceiling) __THROW; #endif #ifdef __USE_GNU diff --git a/nptl/sysdeps/unix/sysv/linux/aio_misc.h b/nptl/sysdeps/unix/sysv/linux/aio_misc.h index 7b0bac75f2..50064c44c1 100644 --- a/nptl/sysdeps/unix/sysv/linux/aio_misc.h +++ b/nptl/sysdeps/unix/sysv/linux/aio_misc.h @@ -22,6 +22,7 @@ # include <signal.h> # include <sysdep.h> # include <pthread.h> +# include <limits.h> # define aio_start_notify_thread __aio_start_notify_thread # define aio_create_helper_thread __aio_create_helper_thread diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/clone.S b/nptl/sysdeps/unix/sysv/linux/alpha/clone.S index eea1cbeed1..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/alpha/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/alpha/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h index 55c464cdc6..1a2e8cbb07 100644 --- a/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h @@ -201,13 +201,14 @@ __lll_mutex_unlock (int *futex) static inline void __attribute__ ((always_inline)) -__lll_robust_mutex_unlock (int *futex) +__lll_robust_mutex_unlock (int *futex, int mask) { int val = atomic_exchange_rel (futex, 0); - if (__builtin_expect (val & FUTEX_WAITERS, 0)) + if (__builtin_expect (val & mask, 0)) lll_futex_wake (futex, 1); } -#define lll_robust_mutex_unlock(futex) __lll_robust_mutex_unlock(&(futex)) +#define lll_robust_mutex_unlock(futex) \ + __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS) static inline void __attribute__ ((always_inline)) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/clone.S b/nptl/sysdeps/unix/sysv/linux/i386/clone.S index 95c17f18e4..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/i386/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/i386/vfork.S b/nptl/sysdeps/unix/sysv/linux/i386/vfork.S index 52336102c7..37f0842051 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/vfork.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/vfork.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999,2002,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,10 +16,17 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <tcb-offsets.h> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <vfork.S> +#else + +# include <tcb-offsets.h> /* Save the PID value. */ -#define SAVE_PID \ +# define SAVE_PID \ movl %gs:PID, %edx; \ movl %edx, %eax; \ negl %eax; \ @@ -28,11 +35,11 @@ 1: movl %eax, %gs:PID /* Restore the old PID value in the parent. */ -#define RESTORE_PID \ +# define RESTORE_PID \ testl %eax, %eax; \ je 1f; \ movl %edx, %gs:PID; \ 1: - -#include <sysdeps/unix/sysv/linux/i386/vfork.S> +# include_next <vfork.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S b/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S index 8664056f27..91f28bab37 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S +++ b/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/ia64/clone2.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone2.S> +#else +# define RESET_PID +# include_next <clone2.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h index e07570a939..ece9a7fc72 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h @@ -120,7 +120,7 @@ extern int __lll_robust_lock_wait (int *futex) attribute_hidden; if (atomic_compare_and_exchange_bool_acq (__futex, id, 0) != 0) \ __val = __lll_robust_lock_wait (__futex); \ __val; \ - })) + }) #define lll_robust_mutex_lock(futex, id) __lll_robust_mutex_lock (&(futex), id) @@ -142,7 +142,7 @@ extern int __lll_robust_lock_wait (int *futex) attribute_hidden; if (atomic_compare_and_exchange_bool_acq (__futex, __id, 0) != 0) \ __val = __lll_robust_lock_wait (__futex); \ __val; \ - })) + }) #define lll_robust_mutex_cond_lock(futex, id) \ __lll_robust_mutex_cond_lock (&(futex), id) @@ -174,7 +174,7 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *) if (atomic_compare_and_exchange_bool_acq (__futex, id, 0) != 0) \ __val = __lll_robust_timedlock_wait (__futex, abstime); \ __val; \ - })) + }) #define lll_robust_mutex_timedlock(futex, abstime, id) \ __lll_robust_mutex_timedlock (&(futex), abstime, id) diff --git a/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h deleted file mode 100644 index d5e89a9364..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h +++ /dev/null @@ -1,202 +0,0 @@ -/* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005, 2006 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 _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#if _MIPS_SIM == _ABI64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#else -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 20 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#endif - - -/* Thread identifiers. The structure of the attribute type is - deliberately not exposed. */ -typedef unsigned long int pthread_t; - - -typedef union -{ - char __size[__SIZEOF_PTHREAD_ATTR_T]; - long int __align; -} pthread_attr_t; - - -/* Data structures for mutex handling. The structure of the attribute - type is deliberately not exposed. */ -typedef union -{ - struct __pthread_mutex_s - { - int __lock; - unsigned int __count; - int __owner; -#if _MIPS_SIM == _ABI64 - unsigned int __nusers; -#endif - /* KIND must stay at this position in the structure to maintain - binary compatibility. */ - int __kind; -#if _MIPS_SIM == _ABI64 - int __spins; - struct __pthread_mutex_s *__next; - struct __pthread_mutex_s *__prev; -# define __PTHREAD_MUTEX_HAVE_PREV 1 -#else - unsigned int __nusers; - __extension__ union - { - int __spins; - struct __pthread_mutex_s *__next; - }; -#endif - } __data; - char __size[__SIZEOF_PTHREAD_MUTEX_T]; - long int __align; -} pthread_mutex_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; - int __align; -} pthread_mutexattr_t; - - -/* Data structure for conditional variable handling. The structure of - the attribute type is deliberately not exposed. */ -typedef union -{ - struct - { - int __lock; - unsigned int __futex; - __extension__ unsigned long long int __total_seq; - __extension__ unsigned long long int __wakeup_seq; - __extension__ unsigned long long int __woken_seq; - void *__mutex; - unsigned int __nwaiters; - unsigned int __broadcast_seq; - } __data; - char __size[__SIZEOF_PTHREAD_COND_T]; - __extension__ long long int __align; -} pthread_cond_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_CONDATTR_T]; - int __align; -} pthread_condattr_t; - - -/* Keys for thread-specific data */ -typedef unsigned int pthread_key_t; - - -/* Once-only execution */ -typedef int pthread_once_t; - - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -/* Data structure for read-write lock variable handling. The - structure of the attribute type is deliberately not exposed. */ -typedef union -{ -# if _MIPS_SIM == _ABI64 - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - int __writer; - int __pad1; - unsigned long int __pad2; - unsigned long int __pad3; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned int __flags; - } __data; -# else - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned int __flags; - int __writer; - } __data; -# endif - char __size[__SIZEOF_PTHREAD_RWLOCK_T]; - long int __align; -} pthread_rwlock_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; - long int __align; -} pthread_rwlockattr_t; -#endif - - -#ifdef __USE_XOPEN2K -/* POSIX spinlock data type. */ -typedef volatile int pthread_spinlock_t; - - -/* POSIX barriers data type. The structure of the type is - deliberately not exposed. */ -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIER_T]; - long int __align; -} pthread_barrier_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; - int __align; -} pthread_barrierattr_t; -#endif - - -#endif /* bits/pthreadtypes.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h deleted file mode 100644 index c4440f9e9e..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2002, 2005 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 _SEMAPHORE_H -# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." -#endif - -#if _MIPS_SIM == _ABI64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif - -/* Value returned if `sem_open' failed. */ -#define SEM_FAILED ((sem_t *) 0) - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) - - -typedef union -{ - char __size[__SIZEOF_SEM_T]; - long int __align; -} sem_t; diff --git a/nptl/sysdeps/unix/sysv/linux/mips/clone.S b/nptl/sysdeps/unix/sysv/linux/mips/clone.S deleted file mode 100644 index 80c265bf6c..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/clone.S +++ /dev/null @@ -1,2 +0,0 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/mips/clone.S> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/createthread.c b/nptl/sysdeps/unix/sysv/linux/mips/createthread.c deleted file mode 100644 index 5b2234f470..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/createthread.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2005 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. */ - -/* Value passed to 'clone' for initialization of the thread register. */ -#define TLS_VALUE ((void *) (pd) \ - + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) - -/* Get the real implementation. */ -#include <nptl/sysdeps/pthread/createthread.c> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/fork.c b/nptl/sysdeps/unix/sysv/linux/mips/fork.c deleted file mode 100644 index 06b7e1c69f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/fork.c +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/fork.c" diff --git a/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h deleted file mode 100644 index 7edb28794f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 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 _LOWLEVELLOCK_H -#define _LOWLEVELLOCK_H 1 - -#include <time.h> -#include <sys/param.h> -#include <bits/pthreadtypes.h> -#include <atomic.h> -#include <sysdep.h> - - -#define FUTEX_WAIT 0 -#define FUTEX_WAKE 1 -#define FUTEX_REQUEUE 3 -#define FUTEX_CMP_REQUEUE 4 - -/* Initializer for compatibility lock. */ -#define LLL_MUTEX_LOCK_INITIALIZER (0) - -#define lll_futex_wait(futexp, val) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAIT, (val), 0); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -#define lll_futex_timed_wait(futexp, val, timespec) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAIT, (val), (timespec)); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -#define lll_futex_wake(futexp, nr) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAKE, (nr), 0); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -/* Returns non-zero if error happened, zero if success. */ -#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 6, \ - (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \ - (nr_move), (mutex), (val)); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ - }) - - -static inline int __attribute__((always_inline)) -__lll_mutex_trylock(int *futex) -{ - return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; -} -#define lll_mutex_trylock(lock) __lll_mutex_trylock (&(lock)) - - -static inline int __attribute__((always_inline)) -__lll_mutex_cond_trylock(int *futex) -{ - return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; -} -#define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock)) - - -extern void __lll_lock_wait (int *futex) attribute_hidden; - -static inline void __attribute__((always_inline)) -__lll_mutex_lock(int *futex) -{ - if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) - __lll_lock_wait (futex); -} -#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex)) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_cond_lock (int *futex) -{ - if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0) - __lll_lock_wait (futex); -} -#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex)) - - -extern int __lll_timedlock_wait (int *futex, const struct timespec *) - attribute_hidden; - -static inline int __attribute__ ((always_inline)) -__lll_mutex_timedlock (int *futex, const struct timespec *abstime) -{ - int result = 0; - if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) - result = __lll_timedlock_wait (futex, abstime); - return result; -} -#define lll_mutex_timedlock(futex, abstime) \ - __lll_mutex_timedlock (&(futex), abstime) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_unlock (int *futex) -{ - int val = atomic_exchange_rel (futex, 0); - if (__builtin_expect (val > 1, 0)) - lll_futex_wake (futex, 1); -} -#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex)) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_unlock_force (int *futex) -{ - (void) atomic_exchange_rel (futex, 0); - lll_futex_wake (futex, 1); -} -#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex)) - - -#define lll_mutex_islocked(futex) \ - (futex != 0) - - -/* Our internal lock implementation is identical to the binary-compatible - mutex implementation. */ - -/* Type for lock object. */ -typedef int lll_lock_t; - -/* Initializers for lock. */ -#define LLL_LOCK_INITIALIZER (0) -#define LLL_LOCK_INITIALIZER_LOCKED (1) - -extern int lll_unlock_wake_cb (int *__futex) attribute_hidden; - -/* The states of a lock are: - 0 - untaken - 1 - taken by one user - >1 - taken by more users */ - -#define lll_trylock(lock) lll_mutex_trylock (lock) -#define lll_lock(lock) lll_mutex_lock (lock) -#define lll_unlock(lock) lll_mutex_unlock (lock) -#define lll_islocked(lock) lll_mutex_islocked (lock) - -/* The kernel notifies a process which uses CLONE_CLEARTID via futex - wakeup when the clone terminates. The memory location contains the - thread ID while the clone is running and is reset to zero - afterwards. */ -#define lll_wait_tid(tid) \ - do { \ - __typeof (tid) __tid; \ - while ((__tid = (tid)) != 0) \ - lll_futex_wait (&(tid), __tid); \ - } while (0) - -extern int __lll_timedwait_tid (int *, const struct timespec *) - attribute_hidden; - -#define lll_timedwait_tid(tid, abstime) \ - ({ \ - int __res = 0; \ - if ((tid) != 0) \ - __res = __lll_timedwait_tid (&(tid), (abstime)); \ - __res; \ - }) - - -/* Conditional variable handling. */ - -extern void __lll_cond_wait (pthread_cond_t *cond) - attribute_hidden; -extern int __lll_cond_timedwait (pthread_cond_t *cond, - const struct timespec *abstime) - attribute_hidden; -extern void __lll_cond_wake (pthread_cond_t *cond) - attribute_hidden; -extern void __lll_cond_broadcast (pthread_cond_t *cond) - attribute_hidden; - -#define lll_cond_wait(cond) \ - __lll_cond_wait (cond) -#define lll_cond_timedwait(cond, abstime) \ - __lll_cond_timedwait (cond, abstime) -#define lll_cond_wake(cond) \ - __lll_cond_wake (cond) -#define lll_cond_broadcast(cond) \ - __lll_cond_broadcast (cond) - -#endif /* lowlevellock.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S deleted file mode 100644 index fe2b81bc1f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2005 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 <tls.h> - -/* Save the PID value. */ -#define SAVE_PID \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Negate it. */ \ - sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ - -/* Restore the old PID value in the parent. */ -#define RESTORE_PID \ - beqz v0, 1f; /* If we are the parent... */ \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Re-negate it. */ \ - sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ -1: - -#include <../sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c b/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c deleted file mode 100644 index 649b752f54..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 "pthreadP.h" -#include <lowlevellock.h> - - -unsigned long int __fork_generation attribute_hidden; - - -static void -clear_once_control (void *arg) -{ - pthread_once_t *once_control = (pthread_once_t *) arg; - - *once_control = 0; - lll_futex_wake (once_control, INT_MAX); -} - - -int -__pthread_once (once_control, init_routine) - pthread_once_t *once_control; - void (*init_routine) (void); -{ - while (1) - { - int oldval, val, newval; - - val = *once_control; - do - { - /* Check if the initialized has already been done. */ - if ((val & 2) != 0) - return 0; - - oldval = val; - newval = (oldval & 3) | __fork_generation | 1; - val = atomic_compare_and_exchange_val_acq (once_control, newval, - oldval); - } - while (__builtin_expect (val != oldval, 0)); - - /* Check if another thread already runs the initializer. */ - if ((oldval & 1) != 0) - { - /* Check whether the initializer execution was interrupted - by a fork. */ - if (((oldval ^ newval) & -4) == 0) - { - /* Same generation, some other thread was faster. Wait. */ - lll_futex_wait (once_control, newval); - continue; - } - } - - /* This thread is the first here. Do the initialization. - Register a cleanup handler so that in case the thread gets - interrupted the initialization can be restarted. */ - pthread_cleanup_push (clear_once_control, once_control); - - init_routine (); - - pthread_cleanup_pop (0); - - - /* Add one to *once_control. */ - atomic_increment (once_control); - - /* Wake up all other threads. */ - lll_futex_wake (once_control, INT_MAX); - break; - } - - return 0; -} -weak_alias (__pthread_once, pthread_once) -strong_alias (__pthread_once, __pthread_once_internal) diff --git a/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h deleted file mode 100644 index 02508e2155..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h +++ /dev/null @@ -1,170 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 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 <sysdep.h> -#include <sysdeps/generic/sysdep.h> -#include <tls.h> -#ifndef __ASSEMBLER__ -# include <nptl/pthreadP.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -#ifdef __PIC__ -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .align 2; \ - L(pseudo_start): \ - cfi_startproc; \ - 99: la t9,__syscall_error; \ - jr t9; \ - .type __##syscall_name##_nocancel, @function; \ - .globl __##syscall_name##_nocancel; \ - __##syscall_name##_nocancel: \ - .set noreorder; \ - .cpload t9; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - ret; \ - .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ - ENTRY (name) \ - .set noreorder; \ - .cpload t9; \ - .set reorder; \ - SINGLE_THREAD_P(v1); \ - bne zero, v1, L(pseudo_cancel); \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - ret; \ - L(pseudo_cancel): \ - SAVESTK_##args; \ - sw ra, 28(sp); \ - cfi_rel_offset (ra, 28); \ - sw gp, 32(sp); \ - cfi_rel_offset (gp, 32); \ - PUSHARGS_##args; /* save syscall args */ \ - CENABLE; \ - lw gp, 32(sp); \ - sw v0, 44(sp); /* save mask */ \ - POPARGS_##args; /* restore syscall args */ \ - .set noreorder; \ - li v0, SYS_ify (syscall_name); \ - syscall; \ - .set reorder; \ - sw v0, 36(sp); /* save syscall result */ \ - sw a3, 40(sp); /* save syscall error flag */ \ - lw a0, 44(sp); /* pass mask as arg1 */ \ - CDISABLE; \ - lw gp, 32(sp); \ - lw v0, 36(sp); /* restore syscall result */ \ - lw a3, 40(sp); /* restore syscall error flag */ \ - lw ra, 28(sp); /* restore return address */ \ - .set noreorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - RESTORESTK; \ - L(pseudo_end): \ - .set reorder; - -# undef PSEUDO_END -# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym - -#endif - -# define PUSHARGS_0 /* nothing to do */ -# define PUSHARGS_1 PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0); -# define PUSHARGS_2 PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4); -# define PUSHARGS_3 PUSHARGS_2 sw a2, 8(sp); cfi_rel_offset (a2, 8); -# define PUSHARGS_4 PUSHARGS_3 sw a3, 12(sp); cfi_rel_offset (a3, 12); -# define PUSHARGS_5 PUSHARGS_4 /* handled by SAVESTK_## */ -# define PUSHARGS_6 PUSHARGS_5 -# define PUSHARGS_7 PUSHARGS_6 - -# define POPARGS_0 /* nothing to do */ -# define POPARGS_1 POPARGS_0 lw a0, 0(sp); -# define POPARGS_2 POPARGS_1 lw a1, 4(sp); -# define POPARGS_3 POPARGS_2 lw a2, 8(sp); -# define POPARGS_4 POPARGS_3 lw a3, 12(sp); -# define POPARGS_5 POPARGS_4 /* args already in new stackframe */ -# define POPARGS_6 POPARGS_5 -# define POPARGS_7 POPARGS_6 - - -# define STKSPACE 48 -# define SAVESTK_0 subu sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE) -# define SAVESTK_1 SAVESTK_0 -# define SAVESTK_2 SAVESTK_1 -# define SAVESTK_3 SAVESTK_2 -# define SAVESTK_4 SAVESTK_3 -# define SAVESTK_5 lw t0, 16(sp); \ - SAVESTK_0; \ - sw t0, 16(sp) - -# define SAVESTK_6 lw t0, 16(sp); \ - lw t1, 20(sp); \ - SAVESTK_0; \ - sw t0, 16(sp); \ - sw t1, 20(sp) - -# define SAVESTK_7 lw t0, 16(sp); \ - lw t1, 20(sp); \ - lw t2, 24(sp); \ - SAVESTK_0; \ - sw t0, 16(sp); \ - sw t1, 20(sp); \ - sw t2, 24(sp) - -# define RESTORESTK addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE) - - -/* We use jalr rather than jal. This means that the assembler will not - automatically restore $gp (in case libc has multiple GOTs) so we must - do it manually - which we have to do anyway since we don't use .cprestore. - It also shuts up the assembler warning about not using .cprestore. */ -# ifdef IS_IN_libpthread -# define CENABLE la t9, __pthread_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9; -# elif defined IS_IN_librt -# define CENABLE la t9, __librt_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __librt_disable_asynccancel; jalr t9; -# else -# define CENABLE la t9, __libc_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __libc_disable_asynccancel; jalr t9; -# endif - -# ifndef __ASSEMBLER__ -# define SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) \ - == 0, 1) -# else -# define SINGLE_THREAD_P(reg) \ - READ_THREAD_POINTER(reg); \ - lw reg, MULTIPLE_THREADS_OFFSET(reg) -#endif - -#elif !defined __ASSEMBLER__ - -# define SINGLE_THREAD_P 1 -# define NO_CANCELLATION 1 - -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/mips/vfork.S b/nptl/sysdeps/unix/sysv/linux/mips/vfork.S deleted file mode 100644 index 874a2e2bf4..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/vfork.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2005 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 <tls.h> - -/* Save the PID value. */ -#define SAVE_PID \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Negate it. */ \ - bnez a2, 1f; /* If it was zero... */ \ - lui a2, 0x8000; /* use 0x80000000 instead. */ \ -1: sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ - -/* Restore the old PID value in the parent. */ -#define RESTORE_PID \ - beqz v0, 1f; /* If we are the parent... */ \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Re-negate it. */ \ - lui a0, 0x8000; /* Load 0x80000000... */ \ - bne a2, a0, 2f; /* ... compare against it... */ \ - li a2, 0; /* ... use 0 instead. */ \ -2: sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ -1: - -#include <../sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S index e19579e842..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S @@ -1,3 +1,9 @@ -#define RESET_PID -#include <tcb-offsets.h> -#include <sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index f87adf4737..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -1,3 +1,9 @@ -#define RESET_PID -#include <tcb-offsets.h> -#include <sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 612be091b0..6baab90f56 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -276,17 +276,17 @@ __lll_mutex_unlock (int *futex) static inline void __attribute__ ((always_inline)) -__lll_robust_mutex_unlock (int *futex) +__lll_robust_mutex_unlock (int *futex, int mask) { int oldval; int newval = 0; lll_compare_and_swap (futex, oldval, newval, "slr %2,%2"); - if (oldval & FUTEX_WAITERS) + if (oldval & mask) lll_futex_wake (futex, 1); } #define lll_robust_mutex_unlock(futex) \ - __lll_robust_mutex_unlock(&(futex)) + __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS) static inline void diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S index 682f94dae8..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/s390/s390-32/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S index 87ee2e1846..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/s390/s390-64/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sh/clone.S b/nptl/sysdeps/unix/sysv/linux/sh/clone.S index 62a11972d8..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/sh/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h index 8cdcac5560..90be7bd8d0 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h @@ -1,4 +1,4 @@ /* 4 instruction cycles not accessing cache and TLB are needed after trapa instruction to avoid an SH-4 silicon bug. */ #define NEED_SYSCALL_INST_PAD -#include <sysdeps/unix/sysv/linux/sh/lowlevellock.h> +#include_next <lowlevellock.h> diff --git a/nptl/sysdeps/unix/sysv/linux/sleep.c b/nptl/sysdeps/unix/sysv/linux/sleep.c index c56b49b39f..2dce3210ca 100644 --- a/nptl/sysdeps/unix/sysv/linux/sleep.c +++ b/nptl/sysdeps/unix/sysv/linux/sleep.c @@ -1,2 +1,10 @@ -#include <nptl/pthreadP.h> -#include <sysdeps/unix/sysv/linux/sleep.c> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <sleep.c> +#else +/* This defines the CANCELLATION_P macro, which sleep.c checks for. */ +# include <pthreadP.h> +# include_next <sleep.c> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S index da6197c00d..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/sparc/sparc32/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S index 410f32017a..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/sparc/sparc64/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/clone.S b/nptl/sysdeps/unix/sysv/linux/x86_64/clone.S index dfa6adb3e2..675a997e97 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/clone.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/clone.S @@ -1,2 +1,9 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/x86_64/clone.S> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/vfork.S b/nptl/sysdeps/unix/sysv/linux/x86_64/vfork.S index f68d40439e..9a9912ca85 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/vfork.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/vfork.S @@ -16,9 +16,16 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <tcb-offsets.h> +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <vfork.S> +#else -#define SAVE_PID \ +# include <tcb-offsets.h> + +# define SAVE_PID \ movl %fs:PID, %esi; \ movl $0x80000000, %ecx; \ movl %esi, %edx; \ @@ -26,10 +33,11 @@ cmove %ecx, %edx; \ movl %edx, %fs:PID -#define RESTORE_PID \ +# define RESTORE_PID \ testq %rax, %rax; \ je 1f; \ movl %esi, %fs:PID; \ 1: -#include <sysdeps/unix/sysv/linux/x86_64/vfork.S> +# include_next <vfork.S> +#endif diff --git a/nptl/tst-robust1.c b/nptl/tst-robust1.c index 13267a5efd..9806ca467a 100644 --- a/nptl/tst-robust1.c +++ b/nptl/tst-robust1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. @@ -23,7 +23,8 @@ #include <stdlib.h> -static pthread_mutex_t m; +static pthread_mutex_t m1; +static pthread_mutex_t m2; static pthread_barrier_t b; @@ -43,10 +44,17 @@ tf (void *arg) exit (1); } - int e = LOCK (&m); + int e = LOCK (&m1); if (e != 0) { - printf ("%ld: child: mutex_lock failed with error %d\n", round, e); + printf ("%ld: child: mutex_lock m1 failed with error %d\n", round, e); + exit (1); + } + + e = LOCK (&m2); + if (e != 0) + { + printf ("%ld: child: mutex_lock m2 failed with error %d\n", round, e); exit (1); } @@ -90,9 +98,15 @@ do_test (void) return 1; } #ifndef NOT_CONSISTENT - if (pthread_mutex_init (&m, &a) != 0) + if (pthread_mutex_init (&m1, &a) != 0) { - puts ("mutex_init failed"); + puts ("mutex_init m1 failed"); + return 1; + } + + if (pthread_mutex_init (&m2, &a) != 0) + { + puts ("mutex_init m2 failed"); return 1; } #endif @@ -106,9 +120,14 @@ do_test (void) for (long int round = 1; round < 5; ++round) { #ifdef NOT_CONSISTENT - if (pthread_mutex_init (&m, &a) != 0) + if (pthread_mutex_init (&m1 , &a) != 0) + { + puts ("mutex_init m1 failed"); + return 1; + } + if (pthread_mutex_init (&m2 , &a) != 0) { - puts ("mutex_init failed"); + puts ("mutex_init m2 failed"); return 1; } #endif @@ -157,15 +176,27 @@ do_test (void) } } - e = LOCK (&m); + e = LOCK (&m1); if (e == 0) { - printf ("%ld: parent: mutex_lock succeeded\n", round); + printf ("%ld: parent: mutex_lock m1 succeeded\n", round); return 1; } if (e != EOWNERDEAD) { - printf ("%ld: parent: mutex_lock returned wrong code\n", round); + printf ("%ld: parent: mutex_lock m1 returned wrong code\n", round); + return 1; + } + + e = LOCK (&m2); + if (e == 0) + { + printf ("%ld: parent: mutex_lock m2 succeeded\n", round); + return 1; + } + if (e != EOWNERDEAD) + { + printf ("%ld: parent: mutex_lock m2 returned wrong code\n", round); return 1; } @@ -187,47 +218,86 @@ do_test (void) #endif #ifndef NOT_CONSISTENT - e = pthread_mutex_consistent_np (&m); + e = pthread_mutex_consistent_np (&m1); if (e != 0) { - printf ("%ld: mutex_consistent failed with error %d\n", round, e); + printf ("%ld: mutex_consistent m1 failed with error %d\n", round, e); + return 1; + } + + e = pthread_mutex_consistent_np (&m2); + if (e != 0) + { + printf ("%ld: mutex_consistent m2 failed with error %d\n", round, e); return 1; } #endif - e = pthread_mutex_unlock (&m); + e = pthread_mutex_unlock (&m1); + if (e != 0) + { + printf ("%ld: mutex_unlock m1 failed\n", round); + return 1; + } + + e = pthread_mutex_unlock (&m2); if (e != 0) { - printf ("%ld: mutex_unlocked failed\n", round); + printf ("%ld: mutex_unlock m2 failed\n", round); return 1; } #ifdef NOT_CONSISTENT - e = LOCK (&m); + e = LOCK (&m1); + if (e == 0) + { + printf ("%ld: locking inconsistent mutex m1 succeeded\n", round); + return 1; + } + if (e != ENOTRECOVERABLE) + { + printf ("%ld: locking inconsistent mutex m1 failed with error %d\n", + round, e); + return 1; + } + + if (pthread_mutex_destroy (&m1) != 0) + { + puts ("mutex_destroy m1 failed"); + return 1; + } + + e = LOCK (&m2); if (e == 0) { - printf ("%ld: locking inconsistent mutex succeeded\n", round); + printf ("%ld: locking inconsistent mutex m2 succeeded\n", round); return 1; } if (e != ENOTRECOVERABLE) { - printf ("%ld: locking inconsistent mutex failed with error %d\n", + printf ("%ld: locking inconsistent mutex m2 failed with error %d\n", round, e); return 1; } - if (pthread_mutex_destroy (&m) != 0) + if (pthread_mutex_destroy (&m2) != 0) { - puts ("mutex_destroy failed"); + puts ("mutex_destroy m2 failed"); return 1; } #endif } #ifndef NOT_CONSISTENT - if (pthread_mutex_destroy (&m) != 0) + if (pthread_mutex_destroy (&m1) != 0) + { + puts ("mutex_destroy m1 failed"); + return 1; + } + + if (pthread_mutex_destroy (&m2) != 0) { - puts ("mutex_destroy failed"); + puts ("mutex_destroy m2 failed"); return 1; } #endif diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c index 827d3a97ab..8025168a5e 100644 --- a/nscd/nscd_helper.c +++ b/nscd/nscd_helper.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1998-2002,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -21,6 +21,7 @@ #include <errno.h> #include <fcntl.h> #include <stdbool.h> +#include <time.h> #include <unistd.h> #include <sys/mman.h> #include <sys/poll.h> diff --git a/nscd/selinux.c b/nscd/selinux.c index 138d96d23a..c59251f1b5 100644 --- a/nscd/selinux.c +++ b/nscd/selinux.c @@ -1,5 +1,5 @@ /* SELinux access controls for nscd. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004. diff --git a/po/libc.pot b/po/libc.pot index c38e554fd2..77407a1f61 100644 --- a/po/libc.pot +++ b/po/libc.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: libc 2.3.90\n" -"POT-Creation-Date: 2006-01-07 22:50-0800\n" +"POT-Creation-Date: 2006-02-22 02:00-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -416,15 +416,15 @@ msgid "" "substitution\n" msgstr "" -#: elf/dl-deps.c:470 +#: elf/dl-deps.c:472 msgid "cannot allocate dependency list" msgstr "" -#: elf/dl-deps.c:503 elf/dl-deps.c:558 +#: elf/dl-deps.c:505 elf/dl-deps.c:560 msgid "cannot allocate symbol search list" msgstr "" -#: elf/dl-deps.c:543 +#: elf/dl-deps.c:545 msgid "Filters not supported with LD_TRACE_PRELINKING" msgstr "" @@ -873,8 +873,8 @@ msgstr "" msgid "need absolute file name for configuration file when using -r" msgstr "" -#: elf/ldconfig.c:1099 locale/programs/xmalloc.c:69 malloc/obstack.c:413 -#: posix/getconf.c:980 posix/getconf.c:1157 +#: elf/ldconfig.c:1099 locale/programs/xmalloc.c:69 malloc/obstack.c:434 +#: malloc/obstack.c:436 posix/getconf.c:980 posix/getconf.c:1157 #, c-format msgid "memory exhausted" msgstr "" @@ -1349,31 +1349,31 @@ msgstr "" msgid "rcmd: %s: short read" msgstr "" -#: inet/rcmd.c:482 +#: inet/rcmd.c:481 msgid "lstat failed" msgstr "" -#: inet/rcmd.c:484 +#: inet/rcmd.c:483 msgid "not regular file" msgstr "" -#: inet/rcmd.c:489 +#: inet/rcmd.c:488 msgid "cannot open" msgstr "" -#: inet/rcmd.c:491 +#: inet/rcmd.c:490 msgid "fstat failed" msgstr "" -#: inet/rcmd.c:493 +#: inet/rcmd.c:492 msgid "bad owner" msgstr "" -#: inet/rcmd.c:495 +#: inet/rcmd.c:494 msgid "writeable by other than owner" msgstr "" -#: inet/rcmd.c:497 +#: inet/rcmd.c:496 msgid "hard linked somewhere" msgstr "" @@ -2888,7 +2888,8 @@ msgstr "" msgid "unable to free arguments" msgstr "" -#: nis/nis_error.c:29 posix/regcomp.c:132 sysdeps/gnu/errlist.c:20 +#: nis/nis_error.c:29 nis/ypclnt.c:822 nis/ypclnt.c:910 posix/regcomp.c:132 +#: sysdeps/gnu/errlist.c:20 msgid "Success" msgstr "" @@ -2929,7 +2930,7 @@ msgid "First/next chain broken" msgstr "" #. TRANS Permission denied; the file permissions do not allow the attempted operation. -#: nis/nis_error.c:39 sysdeps/gnu/errlist.c:157 +#: nis/nis_error.c:39 nis/ypclnt.c:867 sysdeps/gnu/errlist.c:157 msgid "Permission denied" msgstr "" @@ -3424,6 +3425,86 @@ msgstr "" msgid "netname2user: should not have uid 0" msgstr "" +#: nis/ypclnt.c:825 +msgid "Request arguments bad" +msgstr "" + +#: nis/ypclnt.c:828 +msgid "RPC failure on NIS operation" +msgstr "" + +#: nis/ypclnt.c:831 +msgid "Can't bind to server which serves this domain" +msgstr "" + +#: nis/ypclnt.c:834 +msgid "No such map in server's domain" +msgstr "" + +#: nis/ypclnt.c:837 +msgid "No such key in map" +msgstr "" + +#: nis/ypclnt.c:840 +msgid "Internal NIS error" +msgstr "" + +#: nis/ypclnt.c:843 +msgid "Local resource allocation failure" +msgstr "" + +#: nis/ypclnt.c:846 +msgid "No more records in map database" +msgstr "" + +#: nis/ypclnt.c:849 +msgid "Can't communicate with portmapper" +msgstr "" + +#: nis/ypclnt.c:852 +msgid "Can't communicate with ypbind" +msgstr "" + +#: nis/ypclnt.c:855 +msgid "Can't communicate with ypserv" +msgstr "" + +#: nis/ypclnt.c:858 +msgid "Local domain name not set" +msgstr "" + +#: nis/ypclnt.c:861 +msgid "NIS map database is bad" +msgstr "" + +#: nis/ypclnt.c:864 +msgid "NIS client/server version mismatch - can't supply service" +msgstr "" + +#: nis/ypclnt.c:870 +msgid "Database is busy" +msgstr "" + +#: nis/ypclnt.c:873 +msgid "Unknown NIS error code" +msgstr "" + +#: nis/ypclnt.c:913 +msgid "Internal ypbind error" +msgstr "" + +#: nis/ypclnt.c:916 +msgid "Domain not bound" +msgstr "" + +#: nis/ypclnt.c:919 +msgid "System resource allocation failure" +msgstr "" + +#: nis/ypclnt.c:922 +msgid "Unknown ypbind error" +msgstr "" + #: nis/ypclnt.c:963 msgid "yp_update: cannot convert host to netname\n" msgstr "" @@ -3915,7 +3996,8 @@ msgid "Invalid numeric uid \"%s\"!" msgstr "" #: nscd/selinux.c:150 -msgid "Failed opening connection to the audit subsystem" +#, c-format +msgid "Failed opening connection to the audit subsystem: %m" msgstr "" #: nscd/selinux.c:162 @@ -4295,7 +4377,6 @@ msgid "Unknown signal" msgstr "" #: string/_strerror.c:44 sysdeps/mach/_strerror.c:87 -#: sysdeps/mach/hurd/mips/dl-machine.c:83 msgid "Unknown error " msgstr "" @@ -5798,7 +5879,7 @@ msgstr "" msgid "State not recoverable" msgstr "" -#: sysdeps/mach/_strerror.c:57 sysdeps/mach/hurd/mips/dl-machine.c:68 +#: sysdeps/mach/_strerror.c:57 msgid "Error in unknown error system: " msgstr "" @@ -5898,38 +5979,43 @@ msgstr "" msgid "cannot read header from `%s'" msgstr "" -#: timezone/zdump.c:212 +#: timezone/zdump.c:215 msgid "lacks alphabetic at start" msgstr "" -#: timezone/zdump.c:214 +#: timezone/zdump.c:217 msgid "has fewer than 3 alphabetics" msgstr "" -#: timezone/zdump.c:216 +#: timezone/zdump.c:219 msgid "has more than 6 alphabetics" msgstr "" -#: timezone/zdump.c:224 +#: timezone/zdump.c:227 msgid "differs from POSIX standard" msgstr "" -#: timezone/zdump.c:280 +#: timezone/zdump.c:233 +#, c-format +msgid "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n" +msgstr "" + +#: timezone/zdump.c:284 #, c-format msgid "" "%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n" msgstr "" -#: timezone/zdump.c:297 +#: timezone/zdump.c:301 #, c-format msgid "%s: wild -c argument %s\n" msgstr "" -#: timezone/zdump.c:388 +#: timezone/zdump.c:392 msgid "Error writing standard output" msgstr "" -#: timezone/zdump.c:411 +#: timezone/zdump.c:415 #, c-format msgid "" "%s: use of -v on system with floating time_t other than float or double\n" @@ -6249,50 +6335,50 @@ msgstr "" msgid "%s: command was '%s', result was %d\n" msgstr "" -#: timezone/zic.c:2061 +#: timezone/zic.c:2062 msgid "Odd number of quotation marks" msgstr "" -#: timezone/zic.c:2082 timezone/zic.c:2101 +#: timezone/zic.c:2083 timezone/zic.c:2102 msgid "time overflow" msgstr "" -#: timezone/zic.c:2148 +#: timezone/zic.c:2149 msgid "use of 2/29 in non leap-year" msgstr "" -#: timezone/zic.c:2183 +#: timezone/zic.c:2184 msgid "" "rule goes past start/end of month--will not work with pre-2004 versions of " "zic" msgstr "" -#: timezone/zic.c:2216 +#: timezone/zic.c:2218 msgid "time zone abbreviation lacks alphabetic at start" msgstr "" -#: timezone/zic.c:2218 +#: timezone/zic.c:2220 msgid "time zone abbreviation has more than 3 alphabetics" msgstr "" -#: timezone/zic.c:2220 +#: timezone/zic.c:2222 msgid "time zone abbreviation has too many alphabetics" msgstr "" -#: timezone/zic.c:2228 +#: timezone/zic.c:2232 msgid "time zone abbreviation differs from POSIX standard" msgstr "" -#: timezone/zic.c:2240 +#: timezone/zic.c:2244 msgid "too many, or too long, time zone abbreviations" msgstr "" -#: timezone/zic.c:2281 +#: timezone/zic.c:2285 #, c-format msgid "%s: Can't create directory %s: %s\n" msgstr "" -#: timezone/zic.c:2303 +#: timezone/zic.c:2307 #, c-format msgid "%s: %d did not sign extend correctly\n" msgstr "" diff --git a/posix/getresgid.c b/posix/getresgid.c index d6a9b52957..eccce7d69c 100644 --- a/posix/getresgid.c +++ b/posix/getresgid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,1998,2002,2006 + 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 @@ -19,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ int -__getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) +__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) { __set_errno (ENOSYS); return -1; diff --git a/posix/getresuid.c b/posix/getresuid.c index 227d6b7ded..83456c29b8 100644 --- a/posix/getresuid.c +++ b/posix/getresuid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,1998,2002,2006 + 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 @@ -19,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ int -__getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) +__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { __set_errno (ENOSYS); return -1; diff --git a/posix/sched_yield.c b/posix/sched_yield.c index ce41ce9b6f..e7a41ea80b 100644 --- a/posix/sched_yield.c +++ b/posix/sched_yield.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 2006 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 @@ -28,6 +28,7 @@ __sched_yield (void) return -1; } stub_warning (sched_yield) +libc_hidden_def (__sched_yield) weak_alias (__sched_yield, sched_yield) #include <stub-tag.h> diff --git a/posix/setresgid.c b/posix/setresgid.c index 78e308c5d0..736c22e4c1 100644 --- a/posix/setresgid.c +++ b/posix/setresgid.c @@ -1,5 +1,5 @@ -/* setresgid -- set effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* setresgid -- set real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2006 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 @@ -20,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ int -__setresgid (gid_t egid, gid_t rgid, gid_t sgid) +__setresgid (gid_t rgid, gid_t egid, gid_t sgid) { __set_errno (ENOSYS); return -1; diff --git a/posix/setresuid.c b/posix/setresuid.c index 430b63b2fd..89263330e3 100644 --- a/posix/setresuid.c +++ b/posix/setresuid.c @@ -1,5 +1,5 @@ -/* setresuid -- set effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* setresuid -- set real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2006 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 @@ -20,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ int -__setresuid (uid_t euid, uid_t ruid, uid_t suid) +__setresuid (uid_t ruid, uid_t euid, uid_t suid) { __set_errno (ENOSYS); return -1; diff --git a/posix/sys/types.h b/posix/sys/types.h index 0a645dbaad..04563a4abc 100644 --- a/posix/sys/types.h +++ b/posix/sys/types.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002 +/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -163,7 +163,9 @@ typedef unsigned int uint; typedef char int8_t; typedef short int int16_t; typedef int int32_t; -# if __GLIBC_HAVE_LONG_LONG +# if __WORDSIZE == 64 +typedef long int int64_t; +# elif __GLIBC_HAVE_LONG_LONG __extension__ typedef long long int int64_t; # endif # endif @@ -172,7 +174,9 @@ __extension__ typedef long long int int64_t; typedef unsigned char u_int8_t; typedef unsigned short int u_int16_t; typedef unsigned int u_int32_t; -# if __GLIBC_HAVE_LONG_LONG +# if __WORDSIZE == 64 +typedef unsigned long int u_int64_t; +# elif __GLIBC_HAVE_LONG_LONG __extension__ typedef unsigned long long int u_int64_t; # endif diff --git a/posix/unistd.h b/posix/unistd.h index acb8f6f11d..c8e8a0594a 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -693,24 +693,24 @@ extern int setegid (__gid_t __gid) __THROW; #endif /* Use BSD. */ #ifdef __USE_GNU -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ -extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid) +extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) __THROW; -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ -extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid) +extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) __THROW; -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ -extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid) +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ +extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW; -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ -extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid) +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ +extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW; #endif @@ -758,7 +758,8 @@ extern int link (__const char *__from, __const char *__to) /* Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ extern int linkat (int __fromfd, __const char *__from, int __tofd, - __const char *__to) __THROW __nonnull ((2, 4)) __wur; + __const char *__to, int __flags) + __THROW __nonnull ((2, 4)) __wur; #endif #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K diff --git a/scripts/config.guess b/scripts/config.guess index 45bee13987..ec46d18caf 100755 --- a/scripts/config.guess +++ b/scripts/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-04-22' +timestamp='2006-02-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,13 +18,15 @@ timestamp='2005-04-22' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Originally written by Per Bothner <per@bothner.com>. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. @@ -66,11 +69,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -196,55 +199,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -297,40 +268,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe - exit 0 ;; + exit ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit 0 ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -338,32 +312,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; + exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -372,10 +346,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -387,10 +361,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -401,40 +375,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -458,32 +432,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -499,29 +474,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -529,7 +504,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -544,14 +519,18 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit 0 ;; + exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -565,28 +544,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -648,9 +627,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -658,11 +647,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -690,161 +679,177 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; + exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:MSYS_NT-*:*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + x86:Interix*:[345]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - amd64:CYGWIN*:*:*) + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin - exit 0 ;; + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu - exit 0 ;; + exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu - exit 0 ;; + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -861,8 +866,12 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -880,15 +889,22 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu - exit 0 ;; + exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu - exit 0 ;; + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -902,7 +918,7 @@ EOF objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -910,25 +926,28 @@ EOF PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit 0 ;; + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -946,15 +965,15 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -971,7 +990,7 @@ EOF LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) LIBC=gnu #else LIBC=gnuaout @@ -981,16 +1000,23 @@ EOF LIBC=dietlibc #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -998,27 +1024,27 @@ EOF # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) + exit ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; + exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1026,15 +1052,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` @@ -1052,73 +1079,73 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv32 fi - exit 0 ;; + exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp - exit 0 ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 - exit 0 ;; + exit ;; paragon:*:*:*) echo i860-intel-osf1 - exit 0 ;; + exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; + exit ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1126,73 +1153,72 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos - exit 0 ;; + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1200,25 +1226,25 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1229,41 +1255,47 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix - exit 0 ;; + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1295,7 +1327,7 @@ main () #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1384,11 +1416,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1397,22 +1430,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi diff --git a/scripts/config.sub b/scripts/config.sub index 87a1ee49e6..ab2c16c0b7 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-04-22' +timestamp='2006-02-27' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +22,15 @@ timestamp='2005-04-22' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # @@ -83,11 +85,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +101,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,8 +120,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -170,6 +173,10 @@ case $os in -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -186,6 +193,10 @@ case $os in # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -238,7 +249,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -247,6 +258,7 @@ case $basic_machine in | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -255,16 +267,18 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ @@ -273,6 +287,9 @@ case $basic_machine in | z8k) basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -280,6 +297,9 @@ case $basic_machine in ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -321,6 +341,7 @@ case $basic_machine in | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -329,18 +350,20 @@ case $basic_machine in | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ + | mt-* \ | msp430-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ @@ -351,6 +374,8 @@ case $basic_machine in | ymp-* \ | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -686,6 +711,9 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -761,9 +789,8 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff ;; os400) basic_machine=powerpc-ibm @@ -794,6 +821,12 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -850,6 +883,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -1089,13 +1126,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1168,20 +1202,23 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1199,7 +1236,7 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1388,6 +1425,9 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; @@ -1559,7 +1599,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/scripts/gen-sorted.awk b/scripts/gen-sorted.awk index a943df6d2f..0092fe61d1 100755 --- a/scripts/gen-sorted.awk +++ b/scripts/gen-sorted.awk @@ -5,23 +5,101 @@ # Written by Ulrich Drepper <drepper@cygnus.com>, 1998. BEGIN { - cnt = 0 + cnt = split(subdirs, all) + 1 dnt = 0 } + +# Let input files have comments. +{ sub(/[ ]*#.*$/, "") } +NF == 0 { next } + { - if ($1 ~ /depend/) { - from[dnt] = $2 - to[dnt] = $3 - ++dnt - } else { - all[cnt++] = $1 + subdir = type = FILENAME; + sub(/^.*\//, "", type); + sub(/\/[^/]+$/, "", subdir); + sub(/^.*\//, "", subdir); + thisdir = ""; +} + +type == "Depend" && NF == 1 { + from[dnt] = subdir; + to[dnt] = $1; + ++dnt; + next +} + +type == "Subdirs" && NF == 1 { thisdir = $1 } + +type == "Subdirs" && NF == 2 && $1 == "first" { + thisdir = $2; + # Make the first dir in the list depend on this one. + from[dnt] = all[1]; + to[dnt] = thisdir; + ++dnt; +} + +type == "Subdirs" && NF == 2 && $1 == "inhibit" { + inhibit[$2] = subdir; + next +} + +type == "Subdirs" && thisdir { + all[cnt++] = thisdir; + + if (FILENAME ~ (srcpfx ? /^\.\.\/sysdeps\// : /^sysdeps\//) \ + || system("test -d " srcpfx thisdir) == 0) { + # This Subdirs file is in the main source tree, + # or this subdirectory exists in the main source tree. + this_srcdir = srcpfx thisdir + } + else { + # The Subdirs file comes from an add-on that should have the subdirectory. + dir = FILENAME; + do + sub(/\/[^/]+$/, "", dir); + while (dir !~ /\/sysdeps$/); + sub(/\/sysdeps$/, "", dir); + if (system("test -d " dir "/" thisdir) == 0) + dir = dir "/" thisdir; + else { + sub(/\/[^/]+$/, "", dir); + if (system("test -d " dir "/" thisdir) == 0) + dir = dir "/" thisdir; + else { + print FILENAME ":" FNR ":", "cannot find", thisdir > "/dev/stderr"; + exit 2 + } + } + file = dir "/Depend"; + if (srcpfx) + sub(/^\.\.\//, "", dir); + if (dir !~ /^\/.*$/) + dir = "$(..)" dir; + print thisdir "-srcdir", ":=", dir; + } + file = this_srcdir "/Depend"; + if (system("test -f " file) == 0) { + ARGV[ARGC++] = file; + # Emit a dependency on the implicitly-read file. + if (srcpfx) + sub(/^\.\.\//, "", file); + if (file !~ /^\/.*$/) + file = "$(..)" file; + print "$(common-objpfx)sysd-sorted:", "$(wildcard", file ")"; } + next } + +{ + print FILENAME ":" FNR ":", "what type of file is this?" > "/dev/stderr"; + exit 2 +} + END { do { moved = 0 for (i = 0; i < dnt; ++i) { - for (j = 0; j < cnt; ++j) { + for (j = 1; j < cnt; ++j) { if (all[j] == from[i]) { for (k = j + 1; k < cnt; ++k) { if (all[k] == to[i]) { @@ -42,11 +120,20 @@ END { break } } - } while (moved) + } while (moved); - printf "sorted-subdirs = " - for (i = 0; i < cnt; ++i) { - printf "%s ", all[i]; + # Make sure we list "elf" last. + saw_elf = 0; + printf "sorted-subdirs :="; + for (i = 1; i < cnt; ++i) { + if (all[i] in inhibit) + continue; + if (all[i] == "elf") + saw_elf = 1; + else + printf " %s", all[i]; } - printf "\n" + printf "%s\n", saw_elf ? " elf" : ""; + + print "sysd-sorted-done := t" } diff --git a/shlib-versions b/shlib-versions index e8c80826d5..0e05015116 100644 --- a/shlib-versions +++ b/shlib-versions @@ -49,21 +49,16 @@ sparc.*-.*-.* WORDSIZE64 sparc64-@VENDOR@-@OS@ # The interface to -lm depends mostly only on cpu, not on operating system. sparc64-.*-linux.* libm=6 GLIBC_2.2 alpha.*-.*-linux.* libm=6.1 -mips.*-.*-linux.* libm=6 GLIBC_2.0 GLIBC_2.2 ia64-.*-linux.* libm=6.1 GLIBC_2.2 sh.*-.*-linux.* libm=6 GLIBC_2.2 -hppa.*-.*-.* libm=6 GLIBC_2.2 .*-.*-linux.* libm=6 .*-.*-gnu-gnu.* libm=6 # We provide libc.so.6 for Linux kernel versions 2.0 and later. alpha.*-.*-linux.* libc=6.1 -# Working mips versions were never released between 2.0 and 2.2. -mips.*-.*-linux.* libc=6 GLIBC_2.0 GLIBC_2.2 ia64-.*-linux.* libc=6.1 GLIBC_2.2 sh.*-.*-linux.* libc=6 GLIBC_2.2 sparc64-.*-linux.* libc=6 GLIBC_2.2 -hppa.*-.*-.* libc=6 GLIBC_2.2 .*-.*-linux.* libc=6 # libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release. @@ -82,8 +77,6 @@ sparc.*-.*-linux.* ld=ld-linux.so.2 alpha.*-.*-linux.* ld=ld-linux.so.2 sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 ia64-.*-linux.* ld=ld-linux-ia64.so.2 GLIBC_2.2 -mips.*-.*-linux.* ld=ld.so.1 GLIBC_2.0 GLIBC_2.2 -hppa.*-.*-.* ld=ld.so.1 GLIBC_2.2 s390x-.*-linux.* ld=ld64.so.1 GLIBC_2.2 powerpc64.*-.*-linux.* ld=ld64.so.1 GLIBC_2.3 cris-.*-linux.* ld=ld.so.1 GLIBC_2.2 @@ -93,7 +86,6 @@ x86_64-.*-linux.* ld=ld-linux-x86-64.so.2 GLIBC_2.2.5 # The -ldl interface (see <dlfcn.h>) is the same on all platforms. alpha.*-.*-linux.* libdl=2.1 -mips.*-.*-linux.* libdl=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libdl=2 # So far the -lutil interface is the same on all platforms, except for the @@ -104,19 +96,11 @@ alpha.*-.*-linux.* libutil=1.1 # Version number 2 is used on other systems for the BIND 4.9.5 resolver # interface. alpha.*-.*-linux.* libresolv=2.1 -mips.*-.*-linux.* libresolv=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libresolv=2 # Interface revision of nss_* modules. This must match NSS_SHLIB_REVISION # in nss/nsswitch.h, which determines the library names used for service # names given in /etc/nsswitch.conf. -mips.*-.*-linux.* libnss_files=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_dns=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_compat=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nis=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nisplus=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_ldap=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libnss_files=2 .*-.*-.* libnss_dns=2 .*-.*-.* libnss_compat=2 @@ -127,7 +111,6 @@ mips.*-.*-linux.* libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 # Version for libnsl with YP and NIS+ functions. alpha.*-.*-linux.* libnsl=1.1 -mips.*-.*-linux.* libnsl=1 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libnsl=1 # This defines the shared library version numbers we will install. @@ -139,11 +122,9 @@ alpha.*-.*-linux.* libBrokenLocale=1.1 ia64-.*-.* libBrokenLocale=1 GLIBC_2.2 sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2 sparc64-.*-.* libBrokenLocale=1 GLIBC_2.2 -hppa-.*-.* libBrokenLocale=1 GLIBC_2.2 .*-.*-.* libBrokenLocale=1 # The real-time library from POSIX.1b. -mips.*-.*-linux.* librt=1 GLIBC_2.0 GLIBC_2.2 .*-.*-.* librt=1 # The asynchronous name lookup library. diff --git a/soft-fp/adddf3.c b/soft-fp/adddf3.c index 6802d13e37..269ef664c7 100644 --- a/soft-fp/adddf3.c +++ b/soft-fp/adddf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "double.h" -double __adddf3(double a, double b) +DFtype __adddf3(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); - FP_UNPACK_D(B, b); + FP_UNPACK_SEMIRAW_D(A, a); + FP_UNPACK_SEMIRAW_D(B, b); FP_ADD_D(R, A, B); - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/addsf3.c b/soft-fp/addsf3.c index a1e7f0c10c..cfd9526ea6 100644 --- a/soft-fp/addsf3.c +++ b/soft-fp/addsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "single.h" -float __addsf3(float a, float b) +SFtype __addsf3(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_S(A, a); - FP_UNPACK_S(B, b); + FP_UNPACK_SEMIRAW_S(A, a); + FP_UNPACK_SEMIRAW_S(B, b); FP_ADD_S(R, A, B); - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/addtf3.c b/soft-fp/addtf3.c index b7348f5acc..f889a189b6 100644 --- a/soft-fp/addtf3.c +++ b/soft-fp/addtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "quad.h" -long double __addtf3(long double a, long double b) +TFtype __addtf3(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_ADD_Q(R, A, B); - FP_PACK_Q(r, R); + FP_PACK_SEMIRAW_Q(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/divdf3.c b/soft-fp/divdf3.c index f8a479dce7..b45a91ce0c 100644 --- a/soft-fp/divdf3.c +++ b/soft-fp/divdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "double.h" -double __divdf3(double a, double b) +DFtype __divdf3(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_D(A, a); diff --git a/soft-fp/divsf3.c b/soft-fp/divsf3.c index 9e9234fddf..d62c7c02b7 100644 --- a/soft-fp/divsf3.c +++ b/soft-fp/divsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "single.h" -float __divsf3(float a, float b) +SFtype __divsf3(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_S(A, a); diff --git a/soft-fp/divtf3.c b/soft-fp/divtf3.c index 264af97cb0..842aa8116e 100644 --- a/soft-fp/divtf3.c +++ b/soft-fp/divtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "quad.h" -long double __divtf3(long double a, long double b) +TFtype __divtf3(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_Q(A, a); diff --git a/soft-fp/double.h b/soft-fp/double.h index 4d66c8d457..86fd8ada86 100644 --- a/soft-fp/double.h +++ b/soft-fp/double.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Double Precision - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -42,16 +42,22 @@ #define _FP_QNANBIT_D \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_IMPLBIT_D \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_OVERFLOW_D \ ((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE) +typedef float DFtype __attribute__((mode(DF))); + #if _FP_W_TYPE_SIZE < 64 union _FP_UNION_D { - double flt; + DFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; @@ -89,6 +95,18 @@ union _FP_UNION_D _FP_UNPACK_CANONICAL(D,2,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(D,X,val); \ + _FP_UNPACK_SEMIRAW(D,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(D,X,val); \ + _FP_UNPACK_SEMIRAW(D,2,X); \ + } while (0) + #define FP_PACK_D(val,X) \ do { \ _FP_PACK_CANONICAL(D,2,X); \ @@ -102,6 +120,19 @@ union _FP_UNION_D _FP_PACK_RAW_2_P(D,val,X); \ } while (0) +#define FP_PACK_SEMIRAW_D(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,2,X); \ + _FP_PACK_RAW_2(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_DP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + #define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X) #define FP_NEG_D(R,X) _FP_NEG(D,2,R,X) #define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y) @@ -125,7 +156,7 @@ union _FP_UNION_D union _FP_UNION_D { - double flt; + DFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; @@ -161,6 +192,18 @@ union _FP_UNION_D _FP_UNPACK_CANONICAL(D,1,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(1,X,val); \ + _FP_UNPACK_SEMIRAW(D,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(1,X,val); \ + _FP_UNPACK_SEMIRAW(D,1,X); \ + } while (0) + #define FP_PACK_D(val,X) \ do { \ _FP_PACK_CANONICAL(D,1,X); \ @@ -174,6 +217,19 @@ union _FP_UNION_D _FP_PACK_RAW_1_P(D,val,X); \ } while (0) +#define FP_PACK_SEMIRAW_D(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,1,X); \ + _FP_PACK_RAW_1(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_DP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + #define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X) #define FP_NEG_D(R,X) _FP_NEG(D,1,R,X) #define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y) diff --git a/soft-fp/eqdf2.c b/soft-fp/eqdf2.c index b2586bdb9c..d1eb97222f 100644 --- a/soft-fp/eqdf2.c +++ b/soft-fp/eqdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "double.h" -int __eqdf2(double a, double b) +int __eqdf2(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); diff --git a/soft-fp/eqsf2.c b/soft-fp/eqsf2.c index d838b52396..371465f74d 100644 --- a/soft-fp/eqsf2.c +++ b/soft-fp/eqsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "single.h" -int __eqsf2(float a, float b) +int __eqsf2(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); diff --git a/soft-fp/eqtf2.c b/soft-fp/eqtf2.c index adb1663edb..59479b47a0 100644 --- a/soft-fp/eqtf2.c +++ b/soft-fp/eqtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "quad.h" -int __eqtf2(long double a, long double b) +int __eqtf2(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); diff --git a/soft-fp/extenddftf2.c b/soft-fp/extenddftf2.c index 53ac72cfca..e25cc5c822 100644 --- a/soft-fp/extenddftf2.c +++ b/soft-fp/extenddftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "double.h" #include "quad.h" -long double __extenddftf2(double a) +TFtype __extenddftf2(DFtype a) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); + FP_UNPACK_RAW_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,D,4,2,R,A); + FP_EXTEND(Q,D,4,2,R,A); #else - FP_CONV(Q,D,2,1,R,A); + FP_EXTEND(Q,D,2,1,R,A); #endif - FP_PACK_Q(r, R); + FP_PACK_RAW_Q(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/extended.h b/soft-fp/extended.h index d34df5d0ce..0f2060e970 100644 --- a/soft-fp/extended.h +++ b/soft-fp/extended.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Extended Precision. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). @@ -39,16 +39,22 @@ #define _FP_QNANBIT_E \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_IMPLBIT_E \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_OVERFLOW_E \ ((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE)) +typedef float XFtype __attribute__((mode(XF))); + #if _FP_W_TYPE_SIZE < 64 union _FP_UNION_E { - long double flt; + XFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN @@ -143,10 +149,22 @@ union _FP_UNION_E #define FP_UNPACK_EP(X,val) \ do { \ - FP_UNPACK_RAW_2_P(X,val); \ + FP_UNPACK_RAW_EP(X,val); \ _FP_UNPACK_CANONICAL(E,4,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_E(X,val) \ + do { \ + _FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_SEMIRAW(E,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_EP(X,val) \ + do { \ + _FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_SEMIRAW(E,4,X); \ + } while (0) + #define FP_PACK_E(val,X) \ do { \ _FP_PACK_CANONICAL(E,4,X); \ @@ -159,6 +177,18 @@ union _FP_UNION_E FP_PACK_RAW_EP(val,X); \ } while (0) +#define FP_PACK_SEMIRAW_E(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,4,X); \ + _FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_EP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,4,X); \ + _FP_PACK_RAW_EP(val,X); \ + } while (0) + #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X) #define FP_NEG_E(R,X) _FP_NEG(E,4,R,X) #define FP_ADD_E(R,X,Y) _FP_ADD(E,4,R,X,Y) @@ -235,7 +265,7 @@ union _FP_UNION_E #else /* not _FP_W_TYPE_SIZE < 64 */ union _FP_UNION_E { - long double flt /* __attribute__((mode(TF))) */ ; + XFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); @@ -324,6 +354,18 @@ union _FP_UNION_E _FP_UNPACK_CANONICAL(E,2,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_E(X,val) \ + do { \ + _FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_SEMIRAW(E,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_EP(X,val) \ + do { \ + _FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_SEMIRAW(E,2,X); \ + } while (0) + #define FP_PACK_E(val,X) \ do { \ _FP_PACK_CANONICAL(E,2,X); \ @@ -336,6 +378,18 @@ union _FP_UNION_E FP_PACK_RAW_EP(val,X); \ } while (0) +#define FP_PACK_SEMIRAW_E(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,2,X); \ + _FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_EP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,2,X); \ + _FP_PACK_RAW_EP(val,X); \ + } while (0) + #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X) #define FP_NEG_E(R,X) _FP_NEG(E,2,R,X) #define FP_ADD_E(R,X,Y) _FP_ADD(E,2,R,X,Y) diff --git a/soft-fp/extendsfdf2.c b/soft-fp/extendsfdf2.c index a418f1967e..220caf930d 100644 --- a/soft-fp/extendsfdf2.c +++ b/soft-fp/extendsfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE double - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "single.h" #include "double.h" -double __extendsfdf2(float a) +DFtype __extendsfdf2(SFtype a) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_S(A, a); + FP_UNPACK_RAW_S(A, a); #if _FP_W_TYPE_SIZE < _FP_FRACBITS_D - FP_CONV(D,S,2,1,R,A); + FP_EXTEND(D,S,2,1,R,A); #else - FP_CONV(D,S,1,1,R,A); + FP_EXTEND(D,S,1,1,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_RAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/extendsftf2.c b/soft-fp/extendsftf2.c index d2735ba1a5..412d2e877c 100644 --- a/soft-fp/extendsftf2.c +++ b/soft-fp/extendsftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "single.h" #include "quad.h" -long double __extendsftf2(float a) +TFtype __extendsftf2(SFtype a) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_S(A, a); + FP_UNPACK_RAW_S(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,S,4,1,R,A); + FP_EXTEND(Q,S,4,1,R,A); #else - FP_CONV(Q,S,2,1,R,A); + FP_EXTEND(Q,S,2,1,R,A); #endif - FP_PACK_Q(r, R); + FP_PACK_RAW_Q(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixdfdi.c b/soft-fp/fixdfdi.c index 201014581f..537de101c6 100644 --- a/soft-fp/fixdfdi.c +++ b/soft-fp/fixdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -DItype __fixdfdi(double a) +DItype __fixdfdi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); - DItype r; + UDItype r; - FP_UNPACK_D(A, a); - FP_TO_INT_D(r, A, 64, 1); + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, DI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixdfsi.c b/soft-fp/fixdfsi.c index 9961d3d560..0607005108 100644 --- a/soft-fp/fixdfsi.c +++ b/soft-fp/fixdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -SItype __fixdfsi(double a) +SItype __fixdfsi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); - SItype r; + USItype r; - FP_UNPACK_D(A, a); - FP_TO_INT_D(r, A, 32, 1); + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, SI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixsfdi.c b/soft-fp/fixsfdi.c index f3fd2e77a1..d9ef9e843b 100644 --- a/soft-fp/fixsfdi.c +++ b/soft-fp/fixsfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -DItype __fixsfdi(float a) +DItype __fixsfdi(SFtype a) { FP_DECL_EX; FP_DECL_S(A); - DItype r; + UDItype r; - FP_UNPACK_S(A, a); - FP_TO_INT_S(r, A, 64, 1); + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, DI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixsfsi.c b/soft-fp/fixsfsi.c index e8251d18b6..916b079387 100644 --- a/soft-fp/fixsfsi.c +++ b/soft-fp/fixsfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -SItype __fixsfsi(float a) +SItype __fixsfsi(SFtype a) { FP_DECL_EX; FP_DECL_S(A); - SItype r; + USItype r; - FP_UNPACK_S(A, a); - FP_TO_INT_S(r, A, 32, 1); + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, SI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixtfdi.c b/soft-fp/fixtfdi.c index fda412261d..73a1cc7cbf 100644 --- a/soft-fp/fixtfdi.c +++ b/soft-fp/fixtfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -DItype __fixtfdi(long double a) +DItype __fixtfdi(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); - DItype r; + UDItype r; - FP_UNPACK_Q(A, a); - FP_TO_INT_Q(r, A, 64, 1); + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, DI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixtfsi.c b/soft-fp/fixtfsi.c index da51cf951b..78bad0ee39 100644 --- a/soft-fp/fixtfsi.c +++ b/soft-fp/fixtfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -SItype __fixtfsi(long double a) +SItype __fixtfsi(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); - SItype r; + USItype r; - FP_UNPACK_Q(A, a); - FP_TO_INT_Q(r, A, 32, 1); + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, SI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunsdfdi.c b/soft-fp/fixunsdfdi.c index 18bc61ca30..b350d95272 100644 --- a/soft-fp/fixunsdfdi.c +++ b/soft-fp/fixunsdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -UDItype __fixunsdfdi(double a) +UDItype __fixunsdfdi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); UDItype r; - FP_UNPACK_D(A, a); - FP_TO_INT_D(r, A, 64, 0); + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, DI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunsdfsi.c b/soft-fp/fixunsdfsi.c index 4060b5119a..c363e5fbce 100644 --- a/soft-fp/fixunsdfsi.c +++ b/soft-fp/fixunsdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -USItype __fixunsdfsi(double a) +USItype __fixunsdfsi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); USItype r; - FP_UNPACK_D(A, a); - FP_TO_INT_D(r, A, 32, 0); + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, SI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunssfdi.c b/soft-fp/fixunssfdi.c index 6e4f5beb30..6a43cb88ef 100644 --- a/soft-fp/fixunssfdi.c +++ b/soft-fp/fixunssfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -UDItype __fixunssfdi(float a) +UDItype __fixunssfdi(SFtype a) { FP_DECL_EX; FP_DECL_S(A); UDItype r; - FP_UNPACK_S(A, a); - FP_TO_INT_S(r, A, 64, 0); + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, DI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunssfsi.c b/soft-fp/fixunssfsi.c index 5c3e99305e..3ddcee55de 100644 --- a/soft-fp/fixunssfsi.c +++ b/soft-fp/fixunssfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -USItype __fixunssfsi(float a) +USItype __fixunssfsi(SFtype a) { FP_DECL_EX; FP_DECL_S(A); USItype r; - FP_UNPACK_S(A, a); - FP_TO_INT_S(r, A, 32, 0); + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, SI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunstfdi.c b/soft-fp/fixunstfdi.c index a8ac454ce4..0bf5327d1c 100644 --- a/soft-fp/fixunstfdi.c +++ b/soft-fp/fixunstfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -UDItype __fixunstfdi(long double a) +UDItype __fixunstfdi(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); UDItype r; - FP_UNPACK_Q(A, a); - FP_TO_INT_Q(r, A, 64, 0); + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, DI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/fixunstfsi.c b/soft-fp/fixunstfsi.c index 812fb8ef26..387b9c615b 100644 --- a/soft-fp/fixunstfsi.c +++ b/soft-fp/fixunstfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -USItype __fixunstfsi(long double a) +USItype __fixunstfsi(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); USItype r; - FP_UNPACK_Q(A, a); - FP_TO_INT_Q(r, A, 32, 0); + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, SI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/floatdidf.c b/soft-fp/floatdidf.c index 38303f292f..2c6800010f 100644 --- a/soft-fp/floatdidf.c +++ b/soft-fp/floatdidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE double - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -double __floatdidf(DItype i) +DFtype __floatdidf(DItype i) { FP_DECL_EX; FP_DECL_D(A); - double a; + DFtype a; - FP_FROM_INT_D(A, i, 64, long long); - FP_PACK_D(a, A); + FP_FROM_INT_D(A, i, DI_BITS, UDItype); + FP_PACK_RAW_D(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatdisf.c b/soft-fp/floatdisf.c index d2a2af0947..36f05ee409 100644 --- a/soft-fp/floatdisf.c +++ b/soft-fp/floatdisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE single - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -float __floatdisf(DItype i) +SFtype __floatdisf(DItype i) { FP_DECL_EX; FP_DECL_S(A); - float a; + SFtype a; - FP_FROM_INT_S(A, i, 64, long long); - FP_PACK_S(a, A); + FP_FROM_INT_S(A, i, DI_BITS, UDItype); + FP_PACK_RAW_S(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatditf.c b/soft-fp/floatditf.c index ef05dee109..03487adfcb 100644 --- a/soft-fp/floatditf.c +++ b/soft-fp/floatditf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE quad - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -long double __floatditf(DItype i) +TFtype __floatditf(DItype i) { FP_DECL_EX; FP_DECL_Q(A); - long double a; + TFtype a; - FP_FROM_INT_Q(A, i, 64, long long); - FP_PACK_Q(a, A); + FP_FROM_INT_Q(A, i, DI_BITS, UDItype); + FP_PACK_RAW_Q(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatsidf.c b/soft-fp/floatsidf.c index e136333d87..d11ddcc9f1 100644 --- a/soft-fp/floatsidf.c +++ b/soft-fp/floatsidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE double - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "double.h" -double __floatsidf(SItype i) +DFtype __floatsidf(SItype i) { FP_DECL_EX; FP_DECL_D(A); - double a; + DFtype a; - FP_FROM_INT_D(A, i, 32, int); - FP_PACK_D(a, A); + FP_FROM_INT_D(A, i, SI_BITS, USItype); + FP_PACK_RAW_D(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatsisf.c b/soft-fp/floatsisf.c index d68f5a8ac1..64006e691b 100644 --- a/soft-fp/floatsisf.c +++ b/soft-fp/floatsisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE single - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "single.h" -float __floatsisf(SItype i) +SFtype __floatsisf(SItype i) { FP_DECL_EX; FP_DECL_S(A); - float a; + SFtype a; - FP_FROM_INT_S(A, i, 32, int); - FP_PACK_S(a, A); + FP_FROM_INT_S(A, i, SI_BITS, USItype); + FP_PACK_RAW_S(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatsitf.c b/soft-fp/floatsitf.c index e982bb7b35..5a64c70bc2 100644 --- a/soft-fp/floatsitf.c +++ b/soft-fp/floatsitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE quad - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,14 +23,14 @@ #include "soft-fp.h" #include "quad.h" -long double __floatsitf(SItype i) +TFtype __floatsitf(SItype i) { FP_DECL_EX; FP_DECL_Q(A); - long double a; + TFtype a; - FP_FROM_INT_Q(A, i, 32, int); - FP_PACK_Q(a, A); + FP_FROM_INT_Q(A, i, SI_BITS, USItype); + FP_PACK_RAW_Q(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatundidf.c b/soft-fp/floatundidf.c index 03bda04e62..dcec2f8360 100644 --- a/soft-fp/floatundidf.c +++ b/soft-fp/floatundidf.c @@ -28,10 +28,10 @@ __floatundidf(UDItype i) { FP_DECL_EX; FP_DECL_D(A); - double a; + DFtype a; - FP_FROM_INT_D(A, i, 64, long long); - FP_PACK_D(a, A); + FP_FROM_INT_D(A, i, DI_BITS, UDItype); + FP_PACK_RAW_D(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatundisf.c b/soft-fp/floatundisf.c index 68aa90fbf7..a2437e4071 100644 --- a/soft-fp/floatundisf.c +++ b/soft-fp/floatundisf.c @@ -28,10 +28,10 @@ __floatundisf(UDItype i) { FP_DECL_EX; FP_DECL_S(A); - float a; + SFtype a; - FP_FROM_INT_S(A, i, 64, long long); - FP_PACK_S(a, A); + FP_FROM_INT_S(A, i, DI_BITS, UDItype); + FP_PACK_RAW_S(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatunditf.c b/soft-fp/floatunditf.c index 2f53f7d6e4..f0fd3af92d 100644 --- a/soft-fp/floatunditf.c +++ b/soft-fp/floatunditf.c @@ -23,15 +23,15 @@ #include "soft-fp.h" #include "quad.h" -long double +TFtype __floatunditf(UDItype i) { FP_DECL_EX; FP_DECL_Q(A); - long double a; + TFtype a; - FP_FROM_INT_Q(A, i, 64, long long); - FP_PACK_Q(a, A); + FP_FROM_INT_Q(A, i, DI_BITS, UDItype); + FP_PACK_RAW_Q(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatunsidf.c b/soft-fp/floatunsidf.c index 2649adcb6d..b43ed35cd7 100644 --- a/soft-fp/floatunsidf.c +++ b/soft-fp/floatunsidf.c @@ -28,10 +28,10 @@ __floatunsidf(USItype i) { FP_DECL_EX; FP_DECL_D(A); - double a; + DFtype a; - FP_FROM_INT_D(A, i, 32, int); - FP_PACK_D(a, A); + FP_FROM_INT_D(A, i, SI_BITS, USItype); + FP_PACK_RAW_D(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatunsisf.c b/soft-fp/floatunsisf.c index a7f21ca68b..16fbf1dddb 100644 --- a/soft-fp/floatunsisf.c +++ b/soft-fp/floatunsisf.c @@ -28,10 +28,10 @@ __floatunsisf(USItype i) { FP_DECL_EX; FP_DECL_S(A); - float a; + SFtype a; - FP_FROM_INT_S(A, i, 32, int); - FP_PACK_S(a, A); + FP_FROM_INT_S(A, i, SI_BITS, USItype); + FP_PACK_RAW_S(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/floatunsitf.c b/soft-fp/floatunsitf.c index efb66e9f0a..afc3b7862b 100644 --- a/soft-fp/floatunsitf.c +++ b/soft-fp/floatunsitf.c @@ -23,15 +23,15 @@ #include "soft-fp.h" #include "quad.h" -long double +TFtype __floatunsitf(USItype i) { FP_DECL_EX; FP_DECL_Q(A); - long double a; + TFtype a; - FP_FROM_INT_Q(A, i, 32, int); - FP_PACK_Q(a, A); + FP_FROM_INT_Q(A, i, SI_BITS, USItype); + FP_PACK_RAW_Q(a, A); FP_HANDLE_EXCEPTIONS; return a; diff --git a/soft-fp/gedf2.c b/soft-fp/gedf2.c index 66762d0c81..b3af2f16d8 100644 --- a/soft-fp/gedf2.c +++ b/soft-fp/gedf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "double.h" -int __gedf2(double a, double b) +int __gedf2(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); diff --git a/soft-fp/gesf2.c b/soft-fp/gesf2.c index bc5f431747..d1cdbec7d3 100644 --- a/soft-fp/gesf2.c +++ b/soft-fp/gesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "single.h" -int __gesf2(float a, float b) +int __gesf2(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); diff --git a/soft-fp/getf2.c b/soft-fp/getf2.c index 40a3a51e77..51aa7de370 100644 --- a/soft-fp/getf2.c +++ b/soft-fp/getf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "quad.h" -int __getf2(long double a, long double b) +int __getf2(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); diff --git a/soft-fp/ledf2.c b/soft-fp/ledf2.c index 70d849a1e2..f5efaaabd8 100644 --- a/soft-fp/ledf2.c +++ b/soft-fp/ledf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "double.h" -int __ledf2(double a, double b) +int __ledf2(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); diff --git a/soft-fp/lesf2.c b/soft-fp/lesf2.c index 31c07e6e23..86e0c87a39 100644 --- a/soft-fp/lesf2.c +++ b/soft-fp/lesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "single.h" -int __lesf2(float a, float b) +int __lesf2(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); diff --git a/soft-fp/letf2.c b/soft-fp/letf2.c index 883745ffab..339ee0381f 100644 --- a/soft-fp/letf2.c +++ b/soft-fp/letf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,7 +23,7 @@ #include "soft-fp.h" #include "quad.h" -int __letf2(long double a, long double b) +int __letf2(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); diff --git a/soft-fp/muldf3.c b/soft-fp/muldf3.c index c1521ef9d7..e6f8a0f108 100644 --- a/soft-fp/muldf3.c +++ b/soft-fp/muldf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "double.h" -double __muldf3(double a, double b) +DFtype __muldf3(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_D(A, a); diff --git a/soft-fp/mulsf3.c b/soft-fp/mulsf3.c index 48b215b7d6..b493df8609 100644 --- a/soft-fp/mulsf3.c +++ b/soft-fp/mulsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "single.h" -float __mulsf3(float a, float b) +SFtype __mulsf3(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_S(A, a); diff --git a/soft-fp/multf3.c b/soft-fp/multf3.c index b54eb1a767..067ff1a3f7 100644 --- a/soft-fp/multf3.c +++ b/soft-fp/multf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "quad.h" -long double __multf3(long double a, long double b) +TFtype __multf3(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_Q(A, a); diff --git a/soft-fp/negdf2.c b/soft-fp/negdf2.c index cc287c54fe..cc3ce78f56 100644 --- a/soft-fp/negdf2.c +++ b/soft-fp/negdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "double.h" -double __negdf2(double a) +DFtype __negdf2(DFtype a) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(R); - double r; + DFtype r; FP_UNPACK_D(A, a); FP_NEG_D(R, A); diff --git a/soft-fp/negsf2.c b/soft-fp/negsf2.c index 15bfef4fc1..48ac33b914 100644 --- a/soft-fp/negsf2.c +++ b/soft-fp/negsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "single.h" -float __negsf2(float a) +SFtype __negsf2(SFtype a) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(R); - float r; + SFtype r; FP_UNPACK_S(A, a); FP_NEG_S(R, A); diff --git a/soft-fp/negtf2.c b/soft-fp/negtf2.c index f3eba5f21d..38fbe97d58 100644 --- a/soft-fp/negtf2.c +++ b/soft-fp/negtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "quad.h" -long double __negtf2(long double a) +TFtype __negtf2(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(R); - long double r; + TFtype r; FP_UNPACK_Q(A, a); FP_NEG_Q(R, A); diff --git a/soft-fp/op-1.h b/soft-fp/op-1.h index 367ff2274b..9f58ba6a08 100644 --- a/soft-fp/op-1.h +++ b/soft-fp/op-1.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic one-word fraction declaration and manipulation. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -40,8 +40,16 @@ #define _FP_FRAC_SRL_1(X,N) (X##_f >>= N) /* Right shift with sticky-lsb. */ +#define _FP_FRAC_SRST_1(X,S,N,sz) __FP_FRAC_SRST_1(X##_f, S, N, sz) #define _FP_FRAC_SRS_1(X,N,sz) __FP_FRAC_SRS_1(X##_f, N, sz) +#define __FP_FRAC_SRST_1(X,S,N,sz) \ +do { \ + S = (__builtin_constant_p(N) && (N) == 1 \ + ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0); \ + X = X >> (N); \ +} while (0) + #define __FP_FRAC_SRS_1(X,N,sz) \ (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1 \ ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0))) @@ -282,17 +290,4 @@ * Convert FP values between word sizes */ -#define _FP_FRAC_CONV_1_1(dfs, sfs, D, S) \ - do { \ - D##_f = S##_f; \ - if (_FP_WFRACBITS_##sfs > _FP_WFRACBITS_##dfs) \ - { \ - if (S##_c != FP_CLS_NAN) \ - _FP_FRAC_SRS_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs), \ - _FP_WFRACBITS_##sfs); \ - else \ - _FP_FRAC_SRL_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs)); \ - } \ - else \ - D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs; \ - } while (0) +#define _FP_FRAC_COPY_1_1(D, S) (D##_f = S##_f) diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h index 89da27fa4f..d8b89ff843 100644 --- a/soft-fp/op-2.h +++ b/soft-fp/op-2.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic two-word fraction declaration and manipulation. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -29,61 +29,74 @@ #define _FP_FRAC_LOW_2(X) (X##_f0) #define _FP_FRAC_WORD_2(X,w) (X##_f##w) -#define _FP_FRAC_SLL_2(X,N) \ - do { \ - if ((N) < _FP_W_TYPE_SIZE) \ - { \ - if (__builtin_constant_p(N) && (N) == 1) \ - { \ - X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0); \ - X##_f0 += X##_f0; \ - } \ - else \ - { \ - X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \ - X##_f0 <<= (N); \ - } \ - } \ - else \ - { \ - X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE); \ - X##_f0 = 0; \ - } \ - } while (0) +#define _FP_FRAC_SLL_2(X,N) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + if (__builtin_constant_p(N) && (N) == 1) \ + { \ + X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0); \ + X##_f0 += X##_f0; \ + } \ + else \ + { \ + X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \ + X##_f0 <<= (N); \ + } \ + 0; \ + }) \ + : ({ \ + X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE); \ + X##_f0 = 0; \ + })) + #define _FP_FRAC_SRL_2(X,N) \ - do { \ - if ((N) < _FP_W_TYPE_SIZE) \ - { \ - X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \ - X##_f1 >>= (N); \ - } \ - else \ - { \ - X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE); \ - X##_f1 = 0; \ - } \ - } while (0) +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE); \ + X##_f1 = 0; \ + })) /* Right shift with sticky-lsb. */ -#define _FP_FRAC_SRS_2(X,N,sz) \ - do { \ - if ((N) < _FP_W_TYPE_SIZE) \ - { \ - X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) | \ - (__builtin_constant_p(N) && (N) == 1 \ - ? X##_f0 & 1 \ - : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \ - X##_f1 >>= (N); \ - } \ - else \ - { \ - X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) | \ - (((X##_f1 << (2*_FP_W_TYPE_SIZE - (N))) | \ - X##_f0) != 0)); \ - X##_f1 = 0; \ - } \ - } while (0) +#define _FP_FRAC_SRST_2(X,S, N,sz) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + S = (__builtin_constant_p(N) && (N) == 1 \ + ? X##_f0 & 1 \ + : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0); \ + X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + S = ((((N) == _FP_W_TYPE_SIZE \ + ? 0 \ + : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \ + | X##_f0) != 0); \ + X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE)); \ + X##_f1 = 0; \ + })) + +#define _FP_FRAC_SRS_2(X,N,sz) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) | \ + (__builtin_constant_p(N) && (N) == 1 \ + ? X##_f0 & 1 \ + : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) | \ + ((((N) == _FP_W_TYPE_SIZE \ + ? 0 \ + : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \ + | X##_f0) != 0)); \ + X##_f1 = 0; \ + })) #define _FP_FRAC_ADDI_2(X,I) \ __FP_FRAC_ADDI_2(X##_f1, X##_f0, I) @@ -115,9 +128,9 @@ #define _FP_FRAC_CLEAR_OVERP_2(fs,X) (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs) #define _FP_FRAC_EQ_2(X, Y) (X##_f1 == Y##_f1 && X##_f0 == Y##_f0) #define _FP_FRAC_GT_2(X, Y) \ - (X##_f1 > Y##_f1 || X##_f1 == Y##_f1 && X##_f0 > Y##_f0) + (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0)) #define _FP_FRAC_GE_2(X, Y) \ - (X##_f1 > Y##_f1 || X##_f1 == Y##_f1 && X##_f0 >= Y##_f0) + (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 >= Y##_f0)) #define _FP_ZEROFRAC_2 0, 0 #define _FP_MINFRAC_2 0, 1 @@ -570,16 +583,13 @@ */ #define _FP_FRAC_ASSEMBLE_2(r, X, rsize) \ - do { \ - if (rsize <= _FP_W_TYPE_SIZE) \ - r = X##_f0; \ - else \ - { \ - r = X##_f1; \ - r <<= _FP_W_TYPE_SIZE; \ - r += X##_f0; \ - } \ - } while (0) +(void)((rsize <= _FP_W_TYPE_SIZE) \ + ? ({ r = X##_f0; }) \ + : ({ \ + r = X##_f1; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f0; \ + })) #define _FP_FRAC_DISASSEMBLE_2(X, r, rsize) \ do { \ @@ -591,20 +601,6 @@ * Convert FP values between word sizes */ -#define _FP_FRAC_CONV_1_2(dfs, sfs, D, S) \ - do { \ - if (S##_c != FP_CLS_NAN) \ - _FP_FRAC_SRS_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs), \ - _FP_WFRACBITS_##sfs); \ - else \ - _FP_FRAC_SRL_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs)); \ - D##_f = S##_f0; \ - } while (0) - -#define _FP_FRAC_CONV_2_1(dfs, sfs, D, S) \ - do { \ - D##_f0 = S##_f; \ - D##_f1 = 0; \ - _FP_FRAC_SLL_2(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs)); \ - } while (0) +#define _FP_FRAC_COPY_1_2(D, S) (D##_f = S##_f0) +#define _FP_FRAC_COPY_2_1(D, S) ((D##_f0 = S##_f), (D##_f1 = 0)) diff --git a/soft-fp/op-4.h b/soft-fp/op-4.h index 404cb22848..c0ffaafff6 100644 --- a/soft-fp/op-4.h +++ b/soft-fp/op-4.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic four-word fraction declaration and manipulation. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -78,31 +78,36 @@ * but that if any of the bits that fall off the right hand side * were one then we always set the LSbit. */ -#define _FP_FRAC_SRS_4(X,N,size) \ - do { \ - _FP_I_TYPE _up, _down, _skip, _i; \ - _FP_W_TYPE _s; \ - _skip = (N) / _FP_W_TYPE_SIZE; \ - _down = (N) % _FP_W_TYPE_SIZE; \ - _up = _FP_W_TYPE_SIZE - _down; \ - for (_s = _i = 0; _i < _skip; ++_i) \ - _s |= X##_f[_i]; \ - _s |= X##_f[_i] << _up; \ -/* s is now != 0 if we want to set the LSbit */ \ - if (!_down) \ - for (_i = 0; _i <= 3-_skip; ++_i) \ - X##_f[_i] = X##_f[_i+_skip]; \ - else \ - { \ - for (_i = 0; _i < 3-_skip; ++_i) \ - X##_f[_i] = X##_f[_i+_skip] >> _down \ - | X##_f[_i+_skip+1] << _up; \ - X##_f[_i++] = X##_f[3] >> _down; \ - } \ - for (; _i < 4; ++_i) \ - X##_f[_i] = 0; \ - /* don't fix the LSB until the very end when we're sure f[0] is stable */ \ - X##_f[0] |= (_s != 0); \ +#define _FP_FRAC_SRST_4(X,S,N,size) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _FP_W_TYPE _s; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _down = (N) % _FP_W_TYPE_SIZE; \ + _up = _FP_W_TYPE_SIZE - _down; \ + for (_s = _i = 0; _i < _skip; ++_i) \ + _s |= X##_f[_i]; \ + if (!_down) \ + for (_i = 0; _i <= 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip]; \ + else \ + { \ + _s |= X##_f[_i] << _up; \ + for (_i = 0; _i < 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip] >> _down \ + | X##_f[_i+_skip+1] << _up; \ + X##_f[_i++] = X##_f[3] >> _down; \ + } \ + for (; _i < 4; ++_i) \ + X##_f[_i] = 0; \ + S = (_s != 0); \ + } while (0) + +#define _FP_FRAC_SRS_4(X,N,size) \ + do { \ + int _sticky; \ + _FP_FRAC_SRST_4(X, _sticky, N, size); \ + X##_f[0] |= _sticky; \ } while (0) #define _FP_FRAC_ADD_4(R,X,Y) \ @@ -512,7 +517,7 @@ #ifndef __FP_FRAC_ADD_3 #define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \ do { \ - int _c1, _c2; \ + _FP_W_TYPE _c1, _c2; \ r0 = x0 + y0; \ _c1 = r0 < x0; \ r1 = x1 + y1; \ @@ -526,7 +531,7 @@ #ifndef __FP_FRAC_ADD_4 #define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \ do { \ - int _c1, _c2, _c3; \ + _FP_W_TYPE _c1, _c2, _c3; \ r0 = x0 + y0; \ _c1 = r0 < x0; \ r1 = x1 + y1; \ @@ -544,7 +549,7 @@ #ifndef __FP_FRAC_SUB_3 #define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \ do { \ - int _c1, _c2; \ + _FP_W_TYPE _c1, _c2; \ r0 = x0 - y0; \ _c1 = r0 > x0; \ r1 = x1 - y1; \ @@ -558,7 +563,7 @@ #ifndef __FP_FRAC_SUB_4 #define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \ do { \ - int _c1, _c2, _c3; \ + _FP_W_TYPE _c1, _c2, _c3; \ r0 = x0 - y0; \ _c1 = r0 > x0; \ r1 = x1 - y1; \ @@ -609,26 +614,13 @@ * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do * the ones in op-2.h and op-1.h. */ -#define _FP_FRAC_CONV_1_4(dfs, sfs, D, S) \ - do { \ - if (S##_c != FP_CLS_NAN) \ - _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs), \ - _FP_WFRACBITS_##sfs); \ - else \ - _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs)); \ - D##_f = S##_f[0]; \ - } while (0) +#define _FP_FRAC_COPY_1_4(D, S) (D##_f = S##_f[0]) -#define _FP_FRAC_CONV_2_4(dfs, sfs, D, S) \ - do { \ - if (S##_c != FP_CLS_NAN) \ - _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs), \ - _FP_WFRACBITS_##sfs); \ - else \ - _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs)); \ - D##_f0 = S##_f[0]; \ - D##_f1 = S##_f[1]; \ - } while (0) +#define _FP_FRAC_COPY_2_4(D, S) \ +do { \ + D##_f0 = S##_f[0]; \ + D##_f1 = S##_f[1]; \ +} while (0) /* Assembly/disassembly for converting to/from integral types. * No shifting or overflow handled here. @@ -671,18 +663,15 @@ X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \ } while (0); -#define _FP_FRAC_CONV_4_1(dfs, sfs, D, S) \ - do { \ - D##_f[0] = S##_f; \ - D##_f[1] = D##_f[2] = D##_f[3] = 0; \ - _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs)); \ - } while (0) - -#define _FP_FRAC_CONV_4_2(dfs, sfs, D, S) \ - do { \ - D##_f[0] = S##_f0; \ - D##_f[1] = S##_f1; \ - D##_f[2] = D##_f[3] = 0; \ - _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs)); \ - } while (0) - +#define _FP_FRAC_COPY_4_1(D, S) \ +do { \ + D##_f[0] = S##_f; \ + D##_f[1] = D##_f[2] = D##_f[3] = 0; \ +} while (0) + +#define _FP_FRAC_COPY_4_2(D, S) \ +do { \ + D##_f[0] = S##_f0; \ + D##_f[1] = S##_f1; \ + D##_f[2] = D##_f[3] = 0; \ +} while (0) diff --git a/soft-fp/op-8.h b/soft-fp/op-8.h index 789d383da7..01d92357dd 100644 --- a/soft-fp/op-8.h +++ b/soft-fp/op-8.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic eight-word fraction declaration and manipulation. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz) and @@ -83,13 +83,12 @@ _up = _FP_W_TYPE_SIZE - _down; \ for (_s = _i = 0; _i < _skip; ++_i) \ _s |= X##_f[_i]; \ - _s |= X##_f[_i] << _up; \ -/* s is now != 0 if we want to set the LSbit */ \ if (!_down) \ for (_i = 0; _i <= 7-_skip; ++_i) \ X##_f[_i] = X##_f[_i+_skip]; \ else \ { \ + _s |= X##_f[_i] << _up; \ for (_i = 0; _i < 7-_skip; ++_i) \ X##_f[_i] = X##_f[_i+_skip] >> _down \ | X##_f[_i+_skip+1] << _up; \ diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index f30260ede4..957f71dacd 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -21,8 +21,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define _FP_DECL(wc, X) \ - _FP_I_TYPE X##_c, X##_s, X##_e; \ +#define _FP_DECL(wc, X) \ + _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e; \ _FP_FRAC_DECL_##wc(X) /* @@ -71,6 +71,87 @@ do { \ } \ } while (0) +/* Finish unpacking an fp value in semi-raw mode: the mantissa is + shifted by _FP_WORKBITS but the implicit MSB is not inserted and + other classification is not done. */ +#define _FP_UNPACK_SEMIRAW(fs, wc, X) _FP_FRAC_SLL_##wc(X, _FP_WORKBITS) + +/* A semi-raw value has overflowed to infinity. Adjust the mantissa + and exponent appropriately. */ +#define _FP_OVERFLOW_SEMIRAW(fs, wc, X) \ +do { \ + if (FP_ROUNDMODE == FP_RND_NEAREST \ + || (FP_ROUNDMODE == FP_RND_PINF && !X##_s) \ + || (FP_ROUNDMODE == FP_RND_MINF && X##_s)) \ + { \ + X##_e = _FP_EXPMAX_##fs; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + else \ + { \ + X##_e = _FP_EXPMAX_##fs - 1; \ + FP_SET_EXCEPTION(FP_EX_OVERFLOW); \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \ + } \ +} while (0) + +/* Check for a semi-raw value being a signaling NaN and raise the + invalid exception if so. */ +#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X) \ +do { \ + if (X##_e == _FP_EXPMAX_##fs \ + && !_FP_FRAC_ZEROP_##wc(X) \ + && !(_FP_FRAC_HIGH_##fs(X) & _FP_QNANBIT_SH_##fs)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ +} while (0) + +/* Choose a NaN result from an operation on two semi-raw NaN + values. */ +#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP) \ +do { \ + /* _FP_CHOOSENAN expects raw values, so shift as required. */ \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + _FP_FRAC_SRL_##wc(Y, _FP_WORKBITS); \ + _FP_CHOOSENAN(fs, wc, R, X, Y, OP); \ + _FP_FRAC_SLL_##wc(R, _FP_WORKBITS); \ +} while (0) + +/* Test whether a biased exponent is normal (not zero or maximum). */ +#define _FP_EXP_NORMAL(fs, wc, X) (((X##_e + 1) & _FP_EXPMAX_##fs) > 1) + +/* Prepare to pack an fp value in semi-raw mode: the mantissa is + rounded and shifted right, with the rounding possibly increasing + the exponent (including changing a finite value to infinity). */ +#define _FP_PACK_SEMIRAW(fs, wc, X) \ +do { \ + _FP_ROUND(wc, X); \ + if (_FP_FRAC_HIGH_##fs(X) \ + & (_FP_OVERFLOW_##fs >> 1)) \ + { \ + _FP_FRAC_HIGH_##fs(X) &= ~(_FP_OVERFLOW_##fs >> 1); \ + X##_e++; \ + if (X##_e == _FP_EXPMAX_##fs) \ + _FP_OVERFLOW_SEMIRAW(fs, wc, X); \ + } \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + if (!_FP_EXP_NORMAL(fs, wc, X) && !_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (X##_e == 0) \ + FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + else \ + { \ + if (!_FP_KEEPNANFRACP) \ + { \ + _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \ + X##_s = _FP_NANSIGN_##fs; \ + } \ + else \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \ + } \ + } \ +} while (0) + /* * Before packing the bits back into the native fp result, take care * of such mundane things as rounding and overflow. Also, for some @@ -202,153 +283,433 @@ do { \ -/* - * Main addition routine. The input values should be cooked. - */ - -#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP) \ -do { \ - switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \ - { \ - case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \ - { \ - /* shift the smaller number so that its exponent matches the larger */ \ - _FP_I_TYPE diff = X##_e - Y##_e; \ - \ - if (diff < 0) \ - { \ - diff = -diff; \ - if (diff <= _FP_WFRACBITS_##fs) \ - _FP_FRAC_SRS_##wc(X, diff, _FP_WFRACBITS_##fs); \ - else if (!_FP_FRAC_ZEROP_##wc(X)) \ - _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ - R##_e = Y##_e; \ - } \ - else \ - { \ - if (diff > 0) \ - { \ - if (diff <= _FP_WFRACBITS_##fs) \ - _FP_FRAC_SRS_##wc(Y, diff, _FP_WFRACBITS_##fs); \ - else if (!_FP_FRAC_ZEROP_##wc(Y)) \ - _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \ - } \ - R##_e = X##_e; \ - } \ - \ - R##_c = FP_CLS_NORMAL; \ - \ - if (X##_s == Y##_s) \ - { \ - R##_s = X##_s; \ - _FP_FRAC_ADD_##wc(R, X, Y); \ - if (_FP_FRAC_OVERP_##wc(fs, R)) \ - { \ - _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ - R##_e++; \ - } \ - } \ - else \ - { \ - R##_s = X##_s; \ - _FP_FRAC_SUB_##wc(R, X, Y); \ - if (_FP_FRAC_ZEROP_##wc(R)) \ - { \ - /* return an exact zero */ \ - if (FP_ROUNDMODE == FP_RND_MINF) \ - R##_s |= Y##_s; \ - else \ - R##_s &= Y##_s; \ - R##_c = FP_CLS_ZERO; \ - } \ - else \ - { \ - if (_FP_FRAC_NEGP_##wc(R)) \ - { \ - _FP_FRAC_SUB_##wc(R, Y, X); \ - R##_s = Y##_s; \ - } \ - \ - /* renormalize after subtraction */ \ - _FP_FRAC_CLZ_##wc(diff, R); \ - diff -= _FP_WFRACXBITS_##fs; \ - if (diff) \ - { \ - R##_e -= diff; \ - _FP_FRAC_SLL_##wc(R, diff); \ - } \ - } \ - } \ - break; \ - } \ - \ - case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \ - _FP_CHOOSENAN(fs, wc, R, X, Y, OP); \ - break; \ - \ - case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \ - R##_e = X##_e; \ - case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \ - case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \ - case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \ - _FP_FRAC_COPY_##wc(R, X); \ - R##_s = X##_s; \ - R##_c = X##_c; \ - break; \ - \ - case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \ - R##_e = Y##_e; \ - case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \ - case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \ - case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \ - _FP_FRAC_COPY_##wc(R, Y); \ - R##_s = Y##_s; \ - R##_c = Y##_c; \ - break; \ - \ - case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \ - if (X##_s != Y##_s) \ - { \ - /* +INF + -INF => NAN */ \ - _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ - R##_s = _FP_NANSIGN_##fs; \ - R##_c = FP_CLS_NAN; \ - FP_SET_EXCEPTION(FP_EX_INVALID); \ - break; \ - } \ - /* FALLTHRU */ \ - \ - case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \ - case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \ - R##_s = X##_s; \ - R##_c = FP_CLS_INF; \ - break; \ - \ - case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \ - case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \ - R##_s = Y##_s; \ - R##_c = FP_CLS_INF; \ - break; \ - \ - case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ - /* make sure the sign is correct */ \ - if (FP_ROUNDMODE == FP_RND_MINF) \ - R##_s = X##_s | Y##_s; \ - else \ - R##_s = X##_s & Y##_s; \ - R##_c = FP_CLS_ZERO; \ - break; \ - \ - default: \ - abort(); \ - } \ +/* Addition on semi-raw values. */ +#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP) \ +do { \ + if (X##_s == Y##_s) \ + { \ + /* Addition. */ \ + R##_s = X##_s; \ + int ediff = X##_e - Y##_e; \ + if (ediff > 0) \ + { \ + R##_e = X##_e; \ + if (Y##_e == 0) \ + { \ + /* Y is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + goto add3; \ + } \ + if (X##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + goto add1; \ + } \ + } \ + else if (X##_e == _FP_EXPMAX_##fs) \ + { \ + /* X is NaN or Inf, Y is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + \ + /* Insert implicit MSB of Y. */ \ + _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs; \ + \ + add1: \ + /* Shift the mantissa of Y to the right EDIFF steps; \ + remember to account later for the implicit MSB of X. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + } \ + else if (ediff < 0) \ + { \ + ediff = -ediff; \ + R##_e = Y##_e; \ + if (X##_e == 0) \ + { \ + /* X is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_ADD_##wc(R, Y, X); \ + goto add3; \ + } \ + if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + goto add2; \ + } \ + } \ + else if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + /* Y is NaN or Inf, X is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + \ + /* Insert implicit MSB of X. */ \ + _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs; \ + \ + add2: \ + /* Shift the mantissa of X to the right EDIFF steps; \ + remember to account later for the implicit MSB of Y. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ + _FP_FRAC_ADD_##wc(R, Y, X); \ + } \ + else \ + { \ + /* ediff == 0. */ \ + if (!_FP_EXP_NORMAL(fs, wc, X)) \ + { \ + if (X##_e == 0) \ + { \ + /* X and Y are zero or denormalized. */ \ + R##_e = 0; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (!_FP_FRAC_ZEROP_##wc(Y)) \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* Normalized result. */ \ + _FP_FRAC_HIGH_##fs(R) \ + &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + R##_e = 1; \ + } \ + goto add_done; \ + } \ + } \ + else \ + { \ + /* X and Y are NaN or Inf. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + R##_e = _FP_EXPMAX_##fs; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_COPY_##wc(R, Y); \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_COPY_##wc(R, X); \ + else \ + _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP); \ + goto add_done; \ + } \ + } \ + /* The exponents of X and Y, both normal, are equal. The \ + implicit MSBs will always add to increase the \ + exponent. */ \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + R##_e = X##_e + 1; \ + _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ + if (R##_e == _FP_EXPMAX_##fs) \ + /* Overflow to infinity (depending on rounding mode). */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, R); \ + goto add_done; \ + } \ + add3: \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* Overflow. */ \ + _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + R##_e++; \ + _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ + if (R##_e == _FP_EXPMAX_##fs) \ + /* Overflow to infinity (depending on rounding mode). */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, R); \ + } \ + add_done: ; \ + } \ + else \ + { \ + /* Subtraction. */ \ + int ediff = X##_e - Y##_e; \ + if (ediff > 0) \ + { \ + R##_e = X##_e; \ + R##_s = X##_s; \ + if (Y##_e == 0) \ + { \ + /* Y is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + goto sub3; \ + } \ + if (X##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + goto sub1; \ + } \ + } \ + else if (X##_e == _FP_EXPMAX_##fs) \ + { \ + /* X is NaN or Inf, Y is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + \ + /* Insert implicit MSB of Y. */ \ + _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs; \ + \ + sub1: \ + /* Shift the mantissa of Y to the right EDIFF steps; \ + remember to account later for the implicit MSB of X. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + } \ + else if (ediff < 0) \ + { \ + ediff = -ediff; \ + R##_e = Y##_e; \ + R##_s = Y##_s; \ + if (X##_e == 0) \ + { \ + /* X is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + goto sub3; \ + } \ + if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + goto sub2; \ + } \ + } \ + else if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + /* Y is NaN or Inf, X is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + \ + /* Insert implicit MSB of X. */ \ + _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs; \ + \ + sub2: \ + /* Shift the mantissa of X to the right EDIFF steps; \ + remember to account later for the implicit MSB of Y. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + } \ + else \ + { \ + /* ediff == 0. */ \ + if (!_FP_EXP_NORMAL(fs, wc, X)) \ + { \ + if (X##_e == 0) \ + { \ + /* X and Y are zero or denormalized. */ \ + R##_e = 0; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_FRAC_COPY_##wc(R, Y); \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + R##_s = Y##_s; \ + } \ + goto sub_done; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_s = X##_s; \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + R##_s = X##_s; \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* |X| < |Y|, negate result. */ \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + R##_s = Y##_s; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(R)) \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + goto sub_done; \ + } \ + } \ + else \ + { \ + /* X and Y are NaN or Inf, of opposite signs. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + R##_e = _FP_EXPMAX_##fs; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + /* Inf - Inf. */ \ + R##_s = _FP_NANSIGN_##fs; \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + _FP_FRAC_SLL_##wc(R, _FP_WORKBITS); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + else \ + { \ + /* Inf - NaN. */ \ + R##_s = Y##_s; \ + _FP_FRAC_COPY_##wc(R, Y); \ + } \ + } \ + else \ + { \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + /* NaN - Inf. */ \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc(R, X); \ + } \ + else \ + { \ + /* NaN - NaN. */ \ + _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP); \ + } \ + } \ + goto sub_done; \ + } \ + } \ + /* The exponents of X and Y, both normal, are equal. The \ + implicit MSBs cancel. */ \ + R##_e = X##_e; \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + R##_s = X##_s; \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* |X| < |Y|, negate result. */ \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + R##_s = Y##_s; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(R)) \ + { \ + R##_e = 0; \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + goto sub_done; \ + } \ + goto norm; \ + } \ + sub3: \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + int diff; \ + /* Carry into most significant bit of larger one of X and Y, \ + canceling it; renormalize. */ \ + _FP_FRAC_HIGH_##fs(R) &= _FP_IMPLBIT_SH_##fs - 1; \ + norm: \ + _FP_FRAC_CLZ_##wc(diff, R); \ + diff -= _FP_WFRACXBITS_##fs; \ + _FP_FRAC_SLL_##wc(R, diff); \ + if (R##_e <= diff) \ + { \ + /* R is denormalized. */ \ + diff = diff - R##_e + 1; \ + _FP_FRAC_SRS_##wc(R, diff, _FP_WFRACBITS_##fs); \ + R##_e = 0; \ + } \ + else \ + { \ + R##_e -= diff; \ + _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + } \ + } \ + sub_done: ; \ + } \ } while (0) #define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+') -#define _FP_SUB(fs, wc, R, X, Y) \ - do { \ - if (Y##_c != FP_CLS_NAN) Y##_s ^= 1; \ - _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-'); \ +#define _FP_SUB(fs, wc, R, X, Y) \ + do { \ + if (!(Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) Y##_s ^= 1; \ + _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-'); \ } while (0) @@ -537,20 +898,20 @@ do { \ /* Simplification for strict equality. */ -#define _FP_CMP_EQ(fs, wc, ret, X, Y) \ - do { \ - /* NANs are unordered */ \ - if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ - || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \ - { \ - ret = 1; \ - } \ - else \ - { \ - ret = !(X##_e == Y##_e \ - && _FP_FRAC_EQ_##wc(X, Y) \ - && (X##_s == Y##_s || !X##_e && _FP_FRAC_ZEROP_##wc(X))); \ - } \ +#define _FP_CMP_EQ(fs, wc, ret, X, Y) \ + do { \ + /* NANs are unordered */ \ + if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ + || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \ + { \ + ret = 1; \ + } \ + else \ + { \ + ret = !(X##_e == Y##_e \ + && _FP_FRAC_EQ_##wc(X, Y) \ + && (X##_s == Y##_s || (!X##_e && _FP_FRAC_ZEROP_##wc(X)))); \ + } \ } while (0) /* Version to test unordered. */ @@ -616,115 +977,277 @@ do { \ } while (0) /* - * Convert from FP to integer + * Convert from FP to integer. Input is raw. */ /* RSIGNED can have following values: * 0: the number is required to be 0..(2^rsize)-1, if not, NV is set plus - * the result is either 0 or (2^rsize)-1 depending on the sign in such case. - * 1: the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is - * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending - * on the sign in such case. + * the result is either 0 or (2^rsize)-1 depending on the sign in such + * case. + * 1: the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, + * NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 + * depending on the sign in such case. * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is - * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending - * on the sign in such case. + * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 + * depending on the sign in such case. */ -#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned) \ - do { \ - switch (X##_c) \ - { \ - case FP_CLS_NORMAL: \ - if (X##_e < 0) \ - { \ - FP_SET_EXCEPTION(FP_EX_INEXACT); \ - case FP_CLS_ZERO: \ - r = 0; \ - } \ - else if (X##_e >= rsize - (rsigned > 0 || X##_s) \ - || (!rsigned && X##_s)) \ - { /* overflow */ \ - case FP_CLS_NAN: \ - case FP_CLS_INF: \ - if (rsigned) \ - { \ - r = 1; \ - r <<= rsize - 1; \ - r -= 1 - X##_s; \ - } else { \ - r = 0; \ - if (X##_s) \ - r = ~r; \ - } \ - FP_SET_EXCEPTION(FP_EX_INVALID); \ - } \ - else \ - { \ - if (_FP_W_TYPE_SIZE*wc < rsize) \ - { \ - _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ - r <<= X##_e - _FP_WFRACBITS_##fs; \ - } \ - else \ - { \ - if (X##_e >= _FP_WFRACBITS_##fs) \ - _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1)); \ - else if (X##_e < _FP_WFRACBITS_##fs - 1) \ - { \ - _FP_FRAC_SRS_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 2), \ - _FP_WFRACBITS_##fs); \ - if (_FP_FRAC_LOW_##wc(X) & 1) \ - FP_SET_EXCEPTION(FP_EX_INEXACT); \ - _FP_FRAC_SRL_##wc(X, 1); \ - } \ - _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ - } \ - if (rsigned && X##_s) \ - r = -r; \ - } \ - break; \ - } \ - } while (0) - -#define _FP_FROM_INT(fs, wc, X, r, rsize, rtype) \ - do { \ - if (r) \ - { \ - unsigned rtype ur_; \ - X##_c = FP_CLS_NORMAL; \ - \ - if ((X##_s = (r < 0))) \ - r = -r; \ - \ - ur_ = (unsigned rtype) r; \ - if (rsize <= _FP_W_TYPE_SIZE) \ - __FP_CLZ(X##_e, ur_); \ - else \ - __FP_CLZ_2(X##_e, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), \ - (_FP_W_TYPE)ur_); \ - if (rsize < _FP_W_TYPE_SIZE) \ - X##_e -= (_FP_W_TYPE_SIZE - rsize); \ - X##_e = rsize - X##_e - 1; \ +#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned) \ +do { \ + if (X##_e < _FP_EXPBIAS_##fs) \ + { \ + r = 0; \ + if (X##_e == 0) \ + { \ + if (!_FP_FRAC_ZEROP_##wc(X)) \ + { \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } \ + else \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + else if (X##_e >= _FP_EXPBIAS_##fs + rsize - (rsigned > 0 || X##_s) \ + || (!rsigned && X##_s)) \ + { \ + /* Overflow or converting to the most negative integer. */ \ + if (rsigned) \ + { \ + r = 1; \ + r <<= rsize - 1; \ + r -= 1 - X##_s; \ + } else { \ + r = 0; \ + if (X##_s) \ + r = ~r; \ + } \ \ - if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \ - __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\ - _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ - if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \ - _FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1)); \ - } \ - else \ - { \ - X##_c = FP_CLS_ZERO, X##_s = 0; \ - } \ + if (rsigned && X##_s && X##_e == _FP_EXPBIAS_##fs + rsize - 1) \ + { \ + /* Possibly converting to most negative integer; check the \ + mantissa. */ \ + int inexact = 0; \ + (void)((_FP_FRACBITS_##fs > rsize) \ + ? ({ _FP_FRAC_SRST_##wc(X, inexact, \ + _FP_FRACBITS_##fs - rsize, \ + _FP_FRACBITS_##fs); 0; }) \ + : 0); \ + if (!_FP_FRAC_ZEROP_##wc(X)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + else if (inexact) \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + else \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + else \ + { \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs; \ + if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1) \ + { \ + _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ + r <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \ + } \ + else \ + { \ + int inexact; \ + _FP_FRAC_SRST_##wc(X, inexact, \ + (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1 \ + - X##_e), \ + _FP_FRACBITS_##fs); \ + if (inexact) \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ + } \ + if (rsigned && X##_s) \ + r = -r; \ + } \ +} while (0) + +/* Convert integer to fp. Output is raw. RTYPE is unsigned even if + input is signed. */ +#define _FP_FROM_INT(fs, wc, X, r, rsize, rtype) \ + do { \ + if (r) \ + { \ + rtype ur_; \ + \ + if ((X##_s = (r < 0))) \ + r = -(rtype)r; \ + \ + ur_ = (rtype) r; \ + (void)((rsize <= _FP_W_TYPE_SIZE) \ + ? ({ \ + int lz_; \ + __FP_CLZ(lz_, (_FP_W_TYPE)ur_); \ + X##_e = _FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1 - lz_; \ + }) \ + : ((rsize <= 2 * _FP_W_TYPE_SIZE) \ + ? ({ \ + int lz_; \ + __FP_CLZ_2(lz_, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), \ + (_FP_W_TYPE)ur_); \ + X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \ + - lz_); \ + }) \ + : (abort(), 0))); \ + \ + if (rsize - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs \ + && X##_e >= _FP_EXPMAX_##fs) \ + { \ + /* Exponent too big; overflow to infinity. (May also \ + happen after rounding below.) */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, X); \ + goto pack_semiraw; \ + } \ + \ + if (rsize <= _FP_FRACBITS_##fs \ + || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs) \ + { \ + /* Exactly representable; shift left. */ \ + _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ + _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs \ + + _FP_FRACBITS_##fs - 1 - X##_e)); \ + } \ + else \ + { \ + /* More bits in integer than in floating type; need to \ + round. */ \ + if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e) \ + ur_ = ((ur_ >> (X##_e - _FP_EXPBIAS_##fs \ + - _FP_WFRACBITS_##fs + 1)) \ + | ((ur_ << (rsize - (X##_e - _FP_EXPBIAS_##fs \ + - _FP_WFRACBITS_##fs + 1))) \ + != 0)); \ + _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ + if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0) \ + _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs \ + + _FP_WFRACBITS_##fs - 1 - X##_e)); \ + _FP_FRAC_HIGH_##fs(X) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + pack_semiraw: \ + _FP_PACK_SEMIRAW(fs, wc, X); \ + } \ + } \ + else \ + { \ + X##_s = 0; \ + X##_e = 0; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ } while (0) -#define FP_CONV(dfs,sfs,dwc,swc,D,S) \ - do { \ - _FP_FRAC_CONV_##dwc##_##swc(dfs, sfs, D, S); \ - D##_e = S##_e; \ - D##_c = S##_c; \ - D##_s = S##_s; \ - } while (0) +/* Extend from a narrower floating-point format to a wider one. Input + and output are raw. */ +#define FP_EXTEND(dfs,sfs,dwc,swc,D,S) \ +do { \ + if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs \ + || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \ + < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs) \ + || _FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \ + abort(); \ + D##_s = S##_s; \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + if (_FP_EXP_NORMAL(sfs, swc, S)) \ + { \ + D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs; \ + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs)); \ + } \ + else \ + { \ + if (S##_e == 0) \ + { \ + if (_FP_FRAC_ZEROP_##swc(S)) \ + D##_e = 0; \ + else \ + { \ + int _lz; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_CLZ_##swc(_lz, S); \ + _FP_FRAC_SLL_##dwc(D, \ + _lz + _FP_FRACBITS_##dfs \ + - _FP_FRACTBITS_##sfs); \ + D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1 \ + + _FP_FRACXBITS_##sfs - _lz); \ + } \ + } \ + else \ + { \ + D##_e = _FP_EXPMAX_##dfs; \ + if (!_FP_FRAC_ZEROP_##swc(S)) \ + { \ + if (!(_FP_FRAC_HIGH_RAW_##sfs(S) & _FP_QNANBIT_##sfs)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs \ + - _FP_FRACBITS_##sfs)); \ + } \ + } \ + } \ +} while (0) + +/* Truncate from a wider floating-point format to a narrower one. + Input and output are semi-raw. */ +#define FP_TRUNC(dfs,sfs,dwc,swc,D,S) \ +do { \ + if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs \ + || _FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \ + abort(); \ + D##_s = S##_s; \ + if (_FP_EXP_NORMAL(sfs, swc, S)) \ + { \ + D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs; \ + if (D##_e >= _FP_EXPMAX_##dfs) \ + _FP_OVERFLOW_SEMIRAW(dfs, dwc, D); \ + else \ + { \ + if (D##_e <= 0) \ + { \ + if (D##_e <= 1 - _FP_FRACBITS_##dfs) \ + _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \ + else \ + { \ + _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \ + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs + 1 - D##_e), \ + _FP_WFRACBITS_##sfs); \ + } \ + D##_e = 0; \ + } \ + else \ + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs), \ + _FP_WFRACBITS_##sfs); \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + } \ + } \ + else \ + { \ + if (S##_e == 0) \ + { \ + D##_e = 0; \ + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \ + if (!_FP_FRAC_ZEROP_##swc(S)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + } \ + else \ + { \ + D##_e = _FP_EXPMAX_##dfs; \ + if (_FP_FRAC_ZEROP_##swc(S)) \ + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \ + else \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(sfs, swc, S); \ + _FP_FRAC_SRL_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs)); \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + _FP_FRAC_HIGH_##dfs(D) |= _FP_QNANBIT_SH_##dfs; \ + } \ + } \ + } \ +} while (0) /* * Helper primitives. diff --git a/soft-fp/quad.h b/soft-fp/quad.h index c1dccc49a1..578f17e436 100644 --- a/soft-fp/quad.h +++ b/soft-fp/quad.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Quad Precision. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -42,16 +42,22 @@ #define _FP_QNANBIT_Q \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_IMPLBIT_Q \ ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) #define _FP_OVERFLOW_Q \ ((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE)) +typedef float TFtype __attribute__((mode(TF))); + #if _FP_W_TYPE_SIZE < 64 union _FP_UNION_Q { - long double flt; + TFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN @@ -95,6 +101,18 @@ union _FP_UNION_Q _FP_UNPACK_CANONICAL(Q,4,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_4(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_4_P(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,4,X); \ + } while (0) + #define FP_PACK_Q(val,X) \ do { \ _FP_PACK_CANONICAL(Q,4,X); \ @@ -108,6 +126,19 @@ union _FP_UNION_Q _FP_PACK_RAW_4_P(Q,val,X); \ } while (0) +#define FP_PACK_SEMIRAW_Q(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,4,X); \ + _FP_PACK_RAW_4(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_QP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,4,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_4_P(Q,val,X); \ + } while (0) + #define FP_ISSIGNAN_Q(X) _FP_ISSIGNAN(Q,4,X) #define FP_NEG_Q(R,X) _FP_NEG(Q,4,R,X) #define FP_ADD_Q(R,X,Y) _FP_ADD(Q,4,R,X,Y) @@ -130,7 +161,7 @@ union _FP_UNION_Q #else /* not _FP_W_TYPE_SIZE < 64 */ union _FP_UNION_Q { - long double flt /* __attribute__((mode(TF))) */ ; + TFtype flt /* __attribute__((mode(TF))) */ ; struct { _FP_W_TYPE a, b; } longs; @@ -171,6 +202,18 @@ union _FP_UNION_Q _FP_UNPACK_CANONICAL(Q,2,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_2(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,2,X); \ + } while (0) + #define FP_PACK_Q(val,X) \ do { \ _FP_PACK_CANONICAL(Q,2,X); \ @@ -184,6 +227,19 @@ union _FP_UNION_Q _FP_PACK_RAW_2_P(Q,val,X); \ } while (0) +#define FP_PACK_SEMIRAW_Q(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,2,X); \ + _FP_PACK_RAW_2(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_QP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(Q,val,X); \ + } while (0) + #define FP_ISSIGNAN_Q(X) _FP_ISSIGNAN(Q,2,X) #define FP_NEG_Q(R,X) _FP_NEG(Q,2,R,X) #define FP_ADD_Q(R,X,Y) _FP_ADD(Q,2,R,X,Y) diff --git a/soft-fp/single.h b/soft-fp/single.h index 094dc3c484..ffb31786af 100644 --- a/soft-fp/single.h +++ b/soft-fp/single.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Single Precision. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -26,23 +26,29 @@ #error "Here's a nickel kid. Go buy yourself a real computer." #endif +#define _FP_FRACTBITS_S _FP_W_TYPE_SIZE + #define _FP_FRACBITS_S 24 -#define _FP_FRACXBITS_S (_FP_W_TYPE_SIZE - _FP_FRACBITS_S) +#define _FP_FRACXBITS_S (_FP_FRACTBITS_S - _FP_FRACBITS_S) #define _FP_WFRACBITS_S (_FP_WORKBITS + _FP_FRACBITS_S) -#define _FP_WFRACXBITS_S (_FP_W_TYPE_SIZE - _FP_WFRACBITS_S) +#define _FP_WFRACXBITS_S (_FP_FRACTBITS_S - _FP_WFRACBITS_S) #define _FP_EXPBITS_S 8 #define _FP_EXPBIAS_S 127 #define _FP_EXPMAX_S 255 #define _FP_QNANBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2)) +#define _FP_QNANBIT_SH_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2+_FP_WORKBITS)) #define _FP_IMPLBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1)) +#define _FP_IMPLBIT_SH_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1+_FP_WORKBITS)) #define _FP_OVERFLOW_S ((_FP_W_TYPE)1 << (_FP_WFRACBITS_S)) /* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be chosen by the target machine. */ +typedef float SFtype __attribute__((mode(SF))); + union _FP_UNION_S { - float flt; + SFtype flt; struct { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; @@ -78,6 +84,18 @@ union _FP_UNION_S _FP_UNPACK_CANONICAL(S,1,X); \ } while (0) +#define FP_UNPACK_SEMIRAW_S(X,val) \ + do { \ + _FP_UNPACK_RAW_1(S,X,val); \ + _FP_UNPACK_SEMIRAW(S,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_SP(X,val) \ + do { \ + _FP_UNPACK_RAW_1_P(S,X,val); \ + _FP_UNPACK_SEMIRAW(S,1,X); \ + } while (0) + #define FP_PACK_S(val,X) \ do { \ _FP_PACK_CANONICAL(S,1,X); \ @@ -91,6 +109,19 @@ union _FP_UNION_S _FP_PACK_RAW_1_P(S,val,X); \ } while (0) +#define FP_PACK_SEMIRAW_S(val,X) \ + do { \ + _FP_PACK_SEMIRAW(S,1,X); \ + _FP_PACK_RAW_1(S,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_SP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(S,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(S,val,X); \ + } while (0) + #define FP_ISSIGNAN_S(X) _FP_ISSIGNAN(S,1,X) #define FP_NEG_S(R,X) _FP_NEG(S,1,R,X) #define FP_ADD_S(R,X,Y) _FP_ADD(S,1,R,X,Y) diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index 24a9b33c08..4d4e5d504c 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. - Copyright (C) 1997,1998,1999,2000,2002,2003,2005 + Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), @@ -25,11 +25,19 @@ #ifndef SOFT_FP_H #define SOFT_FP_H +#ifdef _LIBC #include <sfp-machine.h> +#else +#include "sfp-machine.h" +#endif /* Allow sfp-machine to have its own byte order definitions. */ #ifndef __BYTE_ORDER +#ifdef _LIBC #include <endian.h> +#else +#error "endianness not defined by sfp-machine.h" +#endif #endif #define _FP_WORKBITS 3 @@ -172,10 +180,21 @@ typedef unsigned int UHWtype __attribute__((mode(HI))); typedef USItype UHWtype; #endif +#define SI_BITS (__CHAR_BIT__ * (int)sizeof(SItype)) +#define DI_BITS (__CHAR_BIT__ * (int)sizeof(DItype)) + #ifndef umul_ppmm +#ifdef _LIBC #include <stdlib/longlong.h> +#else +#include "longlong.h" +#endif #endif +#ifdef _LIBC #include <stdlib.h> +#else +extern void abort (void); +#endif #endif diff --git a/soft-fp/sqrtdf2.c b/soft-fp/sqrtdf2.c index 48efad9349..b52cafd04d 100644 --- a/soft-fp/sqrtdf2.c +++ b/soft-fp/sqrtdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return sqrt(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "double.h" -double __sqrtdf2(double a) +DFtype __sqrtdf2(DFtype a) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_D(A, a); diff --git a/soft-fp/sqrtsf2.c b/soft-fp/sqrtsf2.c index 1c8aead6eb..436e8cedad 100644 --- a/soft-fp/sqrtsf2.c +++ b/soft-fp/sqrtsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return sqrt(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "single.h" -float __sqrtsf2(float a) +SFtype __sqrtsf2(SFtype a) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_S(A, a); diff --git a/soft-fp/sqrttf2.c b/soft-fp/sqrttf2.c index 241f42dbb4..ac2ad6fc5f 100644 --- a/soft-fp/sqrttf2.c +++ b/soft-fp/sqrttf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return sqrt(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,11 +23,11 @@ #include "soft-fp.h" #include "quad.h" -long double __sqrttf2(long double a) +TFtype __sqrttf2(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; FP_UNPACK_Q(A, a); diff --git a/soft-fp/subdf3.c b/soft-fp/subdf3.c index 11a33395f2..81a2585d62 100644 --- a/soft-fp/subdf3.c +++ b/soft-fp/subdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "double.h" -double __subdf3(double a, double b) +DFtype __subdf3(DFtype a, DFtype b) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); - FP_UNPACK_D(B, b); + FP_UNPACK_SEMIRAW_D(A, a); + FP_UNPACK_SEMIRAW_D(B, b); FP_SUB_D(R, A, B); - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/subsf3.c b/soft-fp/subsf3.c index 84d418b612..843fb5055d 100644 --- a/soft-fp/subsf3.c +++ b/soft-fp/subsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "single.h" -float __subsf3(float a, float b) +SFtype __subsf3(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_S(A, a); - FP_UNPACK_S(B, b); + FP_UNPACK_SEMIRAW_S(A, a); + FP_UNPACK_SEMIRAW_S(B, b); FP_SUB_S(R, A, B); - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/subtf3.c b/soft-fp/subtf3.c index 448d398a95..a8e2eead5f 100644 --- a/soft-fp/subtf3.c +++ b/soft-fp/subtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -23,17 +23,17 @@ #include "soft-fp.h" #include "quad.h" -long double __subtf3(long double a, long double b) +TFtype __subtf3(TFtype a, TFtype b) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); - long double r; + TFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_SUB_Q(R, A, B); - FP_PACK_Q(r, R); + FP_PACK_SEMIRAW_Q(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/truncdfsf2.c b/soft-fp/truncdfsf2.c index f7459513d6..0e802d9dfd 100644 --- a/soft-fp/truncdfsf2.c +++ b/soft-fp/truncdfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE double into IEEE single - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "single.h" #include "double.h" -float __truncdfsf2(double a) +SFtype __truncdfsf2(DFtype a) { FP_DECL_EX; FP_DECL_D(A); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); + FP_UNPACK_SEMIRAW_D(A, a); #if _FP_W_TYPE_SIZE < _FP_FRACBITS_D - FP_CONV(S,D,1,2,R,A); + FP_TRUNC(S,D,1,2,R,A); #else - FP_CONV(S,D,1,1,R,A); + FP_TRUNC(S,D,1,1,R,A); #endif - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/trunctfdf2.c b/soft-fp/trunctfdf2.c index 18ce1d56e8..e88d476f13 100644 --- a/soft-fp/trunctfdf2.c +++ b/soft-fp/trunctfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE double - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "double.h" #include "quad.h" -double __trunctfdf2(long double a) +DFtype __trunctfdf2(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_D(R); - double r; + DFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(D,Q,2,4,R,A); + FP_TRUNC(D,Q,2,4,R,A); #else - FP_CONV(D,Q,1,2,R,A); + FP_TRUNC(D,Q,1,2,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/trunctfsf2.c b/soft-fp/trunctfsf2.c index 32d658ab67..0601cf01fd 100644 --- a/soft-fp/trunctfsf2.c +++ b/soft-fp/trunctfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE single - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,21 +24,21 @@ #include "single.h" #include "quad.h" -float __trunctfsf2(long double a) +SFtype __trunctfsf2(TFtype a) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_S(R); - float r; + SFtype r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(S,Q,1,4,R,A); + FP_TRUNC(S,Q,1,4,R,A); #else - FP_CONV(S,Q,1,2,R,A); + FP_TRUNC(S,Q,1,2,R,A); #endif - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/soft-fp/unorddf2.c b/soft-fp/unorddf2.c index 35f3e673db..c44b61d131 100644 --- a/soft-fp/unorddf2.c +++ b/soft-fp/unorddf2.c @@ -23,7 +23,7 @@ #include "double.h" int -__unorddf2(double a, double b) +__unorddf2(DFtype a, DFtype b) { FP_DECL_D(A); FP_DECL_D(B); int r; diff --git a/soft-fp/unordsf2.c b/soft-fp/unordsf2.c index e741b794c1..4924ddcc1e 100644 --- a/soft-fp/unordsf2.c +++ b/soft-fp/unordsf2.c @@ -23,7 +23,7 @@ #include "single.h" int -__unordsf2(float a, float b) +__unordsf2(SFtype a, SFtype b) { FP_DECL_S(A); FP_DECL_S(B); diff --git a/soft-fp/unordtf2.c b/soft-fp/unordtf2.c index 5e30ddb8d2..f0e43c1dee 100644 --- a/soft-fp/unordtf2.c +++ b/soft-fp/unordtf2.c @@ -23,7 +23,7 @@ #include "quad.h" int -__unordtf2(long double a, long double b) +__unordtf2(TFtype a, TFtype b) { FP_DECL_Q(A); FP_DECL_Q(B); diff --git a/stdlib/Makefile b/stdlib/Makefile index 2690d5dd47..c857eac744 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -83,8 +83,7 @@ routines := $(strip $(routines) $(mpn-routines)) \ dbl2mpn ldbl2mpn \ mpn2flt mpn2dbl mpn2ldbl aux += fpioconst mp_clz_tab -distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h \ - tst-putenvmod.c +distribute := $(distribute) $(mpn-headers) fpioconst.h tst-putenvmod.c tests-extras += tst-putenvmod extra-objs += tst-putenvmod.os diff --git a/stdlib/gen-mpn-copy b/stdlib/gen-mpn-copy deleted file mode 100644 index 01656ae54d..0000000000 --- a/stdlib/gen-mpn-copy +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -translations=' -sparc64 sparc/sparc64 -sparc32/v8 sparc/sparc8 -sparc32 sparc -x86/pentium i386/i586 -x86 i386 -m68k/mc68000 m68k/m68000 -m68k/mc68020 m68k/m68020 -m88k/mc88100 m88k/m88100 -m88k/mc88110 m88k/m88110 -mips3 mips/mips3 -mips2 mips -hppa/hppa1_1 hppa/hppa1.1 -alpha/ev5 alpha/alphaev5 -power rs6000 -am29000 a29k -' - -set $translations -while [ $# -ge 2 ]; do - gmp=$1 glibc=$2 - shift; shift - echo 'mpn-found-1 := $(filter $(gmp-srcdir)/mpn/'$gmp'/%,$(mpn-found)) -mpn-copy-1 := $(patsubst $(gmp-srcdir)/mpn/'$gmp'/%,$(sysdep_dir)/'$glibc\ -'/%,$(mpn-found-1)) -mpn-found := $(filter-out $(mpn-found-1),$(mpn-found)) -mpn-copy-sysdep := $(mpn-copy-sysdep) $(mpn-copy-1) -$(mpn-copy-1): $(sysdep_dir)/'$glibc'/%: \ - $(ignore gmp2glibc.sed) $(gmp-srcdir)/mpn/'$gmp'/% - $(gmp2glibc)' -done - -exit 0 diff --git a/string/tester.c b/string/tester.c index f95270efb4..cccef3ad9d 100644 --- a/string/tester.c +++ b/string/tester.c @@ -344,6 +344,9 @@ test_strncat (void) (void) strncat (one, "gh", 2); equal (one, "abcdgh", 12); /* Count and length equal. */ + + (void) strncat (one, "ij", (size_t)-1); /* set sign bit in count */ + equal (one, "abcdghij", 13); } static void @@ -364,6 +367,8 @@ test_strncmp (void) check (strncmp ("abce", "abc", 3) == 0, 11); /* Count == length. */ check (strncmp ("abcd", "abce", 4) < 0, 12); /* Nudging limit. */ check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */ + check (strncmp ("abc", "", (size_t)-1) > 0, 14); /* set sign bit in count */ + check (strncmp ("abc", "abc", (size_t)-2) == 0, 15); } static void @@ -430,6 +435,29 @@ test_strlen (void) } static void +test_strnlen (void) +{ + it = "strnlen"; + check (strnlen ("", 10) == 0, 1); /* Empty. */ + check (strnlen ("a", 10) == 1, 2); /* Single char. */ + check (strnlen ("abcd", 10) == 4, 3); /* Multiple chars. */ + check (strnlen ("foo", (size_t)-1) == 3, 4); /* limits of n. */ + + { + char buf[4096]; + int i; + char *p; + for (i=0; i < 0x100; i++) + { + p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i; + strcpy (p, "OK"); + strcpy (p+3, "BAD/WRONG"); + check (strnlen (p, 100) == 2, 5+i); + } + } +} + +static void test_strchr (void) { it = "strchr"; @@ -1382,6 +1410,9 @@ main (void) /* strlen. */ test_strlen (); + /* strnlen. */ + test_strnlen (); + /* strchr. */ test_strchr (); diff --git a/sysdeps/alpha/soft-fp/Makefile b/sysdeps/alpha/soft-fp/Makefile index d7e7e2684a..5410a78984 100644 --- a/sysdeps/alpha/soft-fp/Makefile +++ b/sysdeps/alpha/soft-fp/Makefile @@ -4,3 +4,7 @@ ifeq ($(subdir),soft-fp) sysdep_routines += ots_add ots_sub ots_mul ots_div ots_cmp ots_cmpe \ ots_cvtxq ots_cvtqx ots_cvtqux ots_cvttx ots_cvtxt ots_nintxq endif + +ifeq ($(subdir),math) +CPPFLAGS += -I../soft-fp +endif diff --git a/sysdeps/alpha/soft-fp/e_sqrtl.c b/sysdeps/alpha/soft-fp/e_sqrtl.c index a1d09725b7..717d170127 100644 --- a/sysdeps/alpha/soft-fp/e_sqrtl.c +++ b/sysdeps/alpha/soft-fp/e_sqrtl.c @@ -19,7 +19,9 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include "local-soft-fp.h" +#include <stdlib.h> +#include <soft-fp.h> +#include <quad.h> long double __ieee754_sqrtl (const long double a) @@ -27,6 +29,7 @@ __ieee754_sqrtl (const long double a) FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(C); long double c; + long _round = 4; /* dynamic rounding */ FP_INIT_ROUNDMODE; FP_UNPACK_Q(A, a); diff --git a/sysdeps/alpha/soft-fp/ots_add.c b/sysdeps/alpha/soft-fp/ots_add.c index b4f6c28f3d..acf66f316b 100644 --- a/sysdeps/alpha/soft-fp/ots_add.c +++ b/sysdeps/alpha/soft-fp/ots_add.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: addition. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,10 +29,10 @@ _OtsAddX(long al, long ah, long bl, long bh, long _round) FP_DECL_RETURN(c); FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_ADD_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; FP_RETURN(c); diff --git a/sysdeps/alpha/soft-fp/ots_cvtqux.c b/sysdeps/alpha/soft-fp/ots_cvtqux.c index d7ab5bae43..82c50806c4 100644 --- a/sysdeps/alpha/soft-fp/ots_cvtqux.c +++ b/sysdeps/alpha/soft-fp/ots_cvtqux.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: unsigned integer to float conversion. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -33,8 +33,8 @@ _OtsCvtQUX (unsigned long a) FP_DECL_Q(C); FP_DECL_RETURN(c); - FP_FROM_INT_Q(C, a, 64, long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, a, 64, unsigned long); + FP_PACK_RAW_Q(c, C); FP_RETURN(c); } diff --git a/sysdeps/alpha/soft-fp/ots_cvtqx.c b/sysdeps/alpha/soft-fp/ots_cvtqx.c index 0e1c6bdc41..dc80291506 100644 --- a/sysdeps/alpha/soft-fp/ots_cvtqx.c +++ b/sysdeps/alpha/soft-fp/ots_cvtqx.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: signed integer to float conversion. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -33,7 +33,7 @@ _OtsCvtQX (long a) FP_DECL_Q(C); FP_DECL_RETURN(c); - FP_FROM_INT_Q(C, a, 64, long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, a, 64, unsigned long); + FP_PACK_RAW_Q(c, C); FP_RETURN(c); } diff --git a/sysdeps/alpha/soft-fp/ots_cvttx.c b/sysdeps/alpha/soft-fp/ots_cvttx.c index ee5ac324cd..2d0bc9bca9 100644 --- a/sysdeps/alpha/soft-fp/ots_cvttx.c +++ b/sysdeps/alpha/soft-fp/ots_cvttx.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: floating point extension. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -35,13 +35,13 @@ _OtsConvertFloatTX(double a) FP_DECL_Q(C); FP_DECL_RETURN(c); - FP_UNPACK_D(A, a); + FP_UNPACK_RAW_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,D,4,2,C,A); + FP_EXTEND(Q,D,4,2,C,A); #else - FP_CONV(Q,D,2,1,C,A); + FP_EXTEND(Q,D,2,1,C,A); #endif - FP_PACK_Q(c, C); + FP_PACK_RAW_Q(c, C); FP_HANDLE_EXCEPTIONS; FP_RETURN(c); diff --git a/sysdeps/alpha/soft-fp/ots_cvtxq.c b/sysdeps/alpha/soft-fp/ots_cvtxq.c index 1fd47da4f7..2c9df529d5 100644 --- a/sysdeps/alpha/soft-fp/ots_cvtxq.c +++ b/sysdeps/alpha/soft-fp/ots_cvtxq.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: float to integer conversion. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -26,14 +26,15 @@ _OtsCvtXQ (long al, long ah, long _round) { FP_DECL_EX; FP_DECL_Q(A); - long r, s; + unsigned long r; + long s; /* If bit 3 is set, then integer overflow detection is requested. */ s = _round & 8 ? 1 : -1; _round = _round & 3; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, s); if (s > 0 && (_fex &= FP_EX_INVALID)) diff --git a/sysdeps/alpha/soft-fp/ots_cvtxt.c b/sysdeps/alpha/soft-fp/ots_cvtxt.c index 2629dd9e40..6221a2365c 100644 --- a/sysdeps/alpha/soft-fp/ots_cvtxt.c +++ b/sysdeps/alpha/soft-fp/ots_cvtxt.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: floating point truncation. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,13 +31,13 @@ _OtsConvertFloatXT (long al, long ah, long _round) double r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(D,Q,2,4,R,A); + FP_TRUNC(D,Q,2,4,R,A); #else - FP_CONV(D,Q,1,2,R,A); + FP_TRUNC(D,Q,1,2,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/alpha/soft-fp/ots_nintxq.c b/sysdeps/alpha/soft-fp/ots_nintxq.c index 2cb1ca4c2a..a718372af7 100644 --- a/sysdeps/alpha/soft-fp/ots_nintxq.c +++ b/sysdeps/alpha/soft-fp/ots_nintxq.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: convert to fortran nearest. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -26,22 +26,24 @@ _OtsNintXQ (long al, long ah, long _round) { FP_DECL_EX; FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C); - long r, s; + unsigned long r; + long s; /* If bit 3 is set, then integer overflow detection is requested. */ s = _round & 8 ? 1 : -1; _round = _round & 3; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); /* Build 0.5 * sign(A) */ B_e = _FP_EXPBIAS_Q; - __FP_FRAC_SET_2 (B, _FP_IMPLBIT_Q, 0); + __FP_FRAC_SET_2 (B, 0, 0); B_s = A_s; - _FP_UNPACK_CANONICAL(Q,2,B); FP_ADD_Q(C, A, B); + _FP_FRAC_SRL_2(C, _FP_WORKBITS); + _FP_FRAC_HIGH_RAW_Q(C) &= ~(_FP_W_TYPE)_FP_IMPLBIT_Q; FP_TO_INT_Q(r, C, 64, s); if (s > 0 && (_fex &= FP_EX_INVALID)) FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/alpha/soft-fp/ots_sub.c b/sysdeps/alpha/soft-fp/ots_sub.c index c10043f071..5147266a04 100644 --- a/sysdeps/alpha/soft-fp/ots_sub.c +++ b/sysdeps/alpha/soft-fp/ots_sub.c @@ -1,5 +1,5 @@ /* Software floating-point emulation: subtraction. - Copyright (C) 1997,1999,2004 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,10 +29,10 @@ _OtsSubX(long al, long ah, long bl, long bh, long _round) FP_DECL_RETURN(c); FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_SUB_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; FP_RETURN(c); diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index b5f7c3cae5..13fefd9e83 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -1113,6 +1113,11 @@ extern void _dl_add_to_slotinfo (struct link_map *l) attribute_hidden; module with the given index. */ extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid); +/* Look up the module's TLS block as for __tls_get_addr, + but never touch anything. Return null if it's not allocated yet. */ +extern void *_dl_tls_get_addr_soft (struct link_map *l) internal_function; + + __END_DECLS #endif /* ldsodefs.h */ diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile index 2b3194f04a..5b9a0a56ed 100644 --- a/sysdeps/gnu/Makefile +++ b/sysdeps/gnu/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1996,1997,1998,1999,2001,2002,2003,2004, 2005 +# Copyright (C) 1996,1997,1998,1999,2001,2002,2003,2004,2005,2006 # Free Software Foundation, Inc. # This file is part of the GNU C Library. @@ -32,8 +32,7 @@ endif ifeq ($(subdir),stdio-common) -errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c, \ - $(full_config_sysdirs) .))) +errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .))) ifeq ($(versioning),yes) $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \ @@ -47,8 +46,7 @@ endif $(CC) -S $(CPPFLAGS) $(CFLAGS) -DNOT_IN_libc -DEMIT_ERR_MAX $< -o - \ | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \ -f $(..)sysdeps/gnu/errlist-compat.awk \ - $(wildcard $(patsubst %,$(..)%/Versions,\ - $(config-sysdirs) $(add-ons))) > $@T + $(wildcard $(sysdirs:=/Versions)) > $@T # Make it unwritable so noone will edit it by mistake. -chmod a-w $@T mv -f $@T $@ @@ -59,7 +57,8 @@ $(objpfx)errlist-compat.h: $(objpfx)errlist-compat.c generated += errlist-compat.c errlist-compat.h # This will force the generation above to happy if need be. -$(foreach o,.d $(object-suffixes),$(objpfx)errlist$o):$(objpfx)errlist-compat.h +$(foreach o,$(object-suffixes) $(object-suffixes:=.d),\ + $(objpfx)errlist$o): $(objpfx)errlist-compat.h endif ifeq ($(subdir),login) diff --git a/sysdeps/gnu/net/if.h b/sysdeps/gnu/net/if.h index b10245f455..ebb3e9f306 100644 --- a/sysdeps/gnu/net/if.h +++ b/sysdeps/gnu/net/if.h @@ -75,8 +75,10 @@ enum IFF_PORTSEL = 0x2000, /* Can set media type. */ # define IFF_PORTSEL IFF_PORTSEL - IFF_AUTOMEDIA = 0x4000 /* Auto media select active. */ + IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */ # define IFF_AUTOMEDIA IFF_AUTOMEDIA + IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */ +# define IFF_DYNAMIC IFF_DYNAMIC }; /* The ifaddr structure contains information about one address of an diff --git a/sysdeps/hppa/Makefile b/sysdeps/hppa/Makefile deleted file mode 100644 index 73947031dc..0000000000 --- a/sysdeps/hppa/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2000, 2001 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributed by David Huggins-Daines (dhd@debian.org) - -# 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. - -# We used to need this since the build process uses ld -r. Now we use -# ld -r --unique=.text* which does more or less the same thing, but better. -# CFLAGS-.os += -ffunction-sections -LDFLAGS-c_pic.os += -Wl,--unique=.text* - -ifeq ($(subdir),elf) -CFLAGS-rtld.c += -mdisable-fpregs -sysdep-dl-routines += dl-symaddr dl-fptr -sysdep_routines += $(sysdep-dl-routines) -sysdep-rtld-routines += $(sysdep-dl-routines) -endif - -ifeq ($(subdir),csu) -ifeq (yes,$(build-shared)) -# Compatibility -ifeq (yes,$(have-protected)) -CPPFLAGS-libgcc-compat.c = -DHAVE_DOT_HIDDEN -endif -sysdep_routines += libgcc-compat -shared-only-routines += libgcc-compat -endif -endif diff --git a/sysdeps/hppa/Versions b/sysdeps/hppa/Versions deleted file mode 100644 index 2ae3cbdf17..0000000000 --- a/sysdeps/hppa/Versions +++ /dev/null @@ -1,12 +0,0 @@ -ld { - GLIBC_PRIVATE { - # hppa specific functions in the dynamic linker, but used by libc.so. - _dl_symbol_address; _dl_unmap; _dl_lookup_address; - _dl_function_address; - } -} -libc { - GLIBC_2.2 { - __clz_tab; - } -} diff --git a/sysdeps/hppa/__longjmp.S b/sysdeps/hppa/__longjmp.S deleted file mode 100644 index dee4d9f7b5..0000000000 --- a/sysdeps/hppa/__longjmp.S +++ /dev/null @@ -1,72 +0,0 @@ -/* longjmp for PA-RISC. - Copyright (C) 1997, 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 <sysdep.h> -#define _SETJMP_H -#define _ASM -#include <bits/setjmp.h> - -/* __longjmp(jmpbuf, val) */ - - .text - .align 4 - .globl __longjmp - .export __longjmp, code - .proc - .callinfo -__longjmp: - /* set return value */ - copy %r25, %r28 - - ldw 0(%r26), %r3 - ldw 8(%r26), %r4 - ldw 12(%r26), %r5 - ldw 16(%r26), %r6 - ldw 20(%r26), %r7 - ldw 24(%r26), %r8 - ldw 28(%r26), %r9 - ldw 32(%r26), %r10 - ldw 36(%r26), %r11 - ldw 40(%r26), %r12 - ldw 44(%r26), %r13 - ldw 48(%r26), %r14 - ldw 52(%r26), %r15 - ldw 56(%r26), %r16 - ldw 60(%r26), %r17 - ldw 64(%r26), %r18 - ldw 68(%r26), %r19 - ldw 72(%r26), %r27 - ldw 76(%r26), %r30 - - ldw 80(%r26), %rp - - ldo 88(%r26),%r20 - fldds,ma 8(%r20), %fr12 - fldds,ma 8(%r20), %fr13 - fldds,ma 8(%r20), %fr14 - fldds,ma 8(%r20), %fr15 - fldds,ma 8(%r20), %fr16 - fldds,ma 8(%r20), %fr17 - fldds,ma 8(%r20), %fr18 - fldds,ma 8(%r20), %fr19 - fldds,ma 8(%r20), %fr20 - fldds 0(%r20), %fr21 - - bv,n %r0(%r2) - .procend diff --git a/sysdeps/hppa/abort-instr.h b/sysdeps/hppa/abort-instr.h deleted file mode 100644 index f1afea46de..0000000000 --- a/sysdeps/hppa/abort-instr.h +++ /dev/null @@ -1,6 +0,0 @@ -/* An instruction privileged instruction to crash a userspace program. - - We go with iitlbp because it has a history of being used to crash - programs. */ - -#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%r0)") diff --git a/sysdeps/hppa/add_n.s b/sysdeps/hppa/add_n.s deleted file mode 100644 index a396b3471c..0000000000 --- a/sysdeps/hppa/add_n.s +++ /dev/null @@ -1,58 +0,0 @@ -;! HP-PA __mpn_add_n -- Add two limb vectors of the same length > 0 and store -;! sum in a third limb vector. - -;! Copyright (C) 1992, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr gr26 -;! s1_ptr gr25 -;! s2_ptr gr24 -;! size gr23 - -;! One might want to unroll this as for other processors, but it turns -;! out that the data cache contention after a store makes such -;! unrolling useless. We can't come under 5 cycles/limb anyway. - - .text - .export __mpn_add_n -__mpn_add_n: - .proc - .callinfo frame=0,no_calls - .entry - - ldws,ma 4(%r25),%r21 - ldws,ma 4(%r24),%r20 - - addib,= -1,%r23,L$end ;! check for (SIZE == 1) - add %r21,%r20,%r28 ;! add first limbs ignoring cy - -L$loop: ldws,ma 4(%r25),%r21 - ldws,ma 4(%r24),%r20 - stws,ma %r28,4(%r26) - addib,<> -1,%r23,L$loop - addc %r21,%r20,%r28 - -L$end: stws %r28,0(%r26) - bv 0(%r2) - addc %r0,%r0,%r28 - - .exit - .procend diff --git a/sysdeps/hppa/bits/endian.h b/sysdeps/hppa/bits/endian.h deleted file mode 100644 index 585db0c0fa..0000000000 --- a/sysdeps/hppa/bits/endian.h +++ /dev/null @@ -1,7 +0,0 @@ -/* hppa1.1 big-endian. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/hppa/bits/link.h b/sysdeps/hppa/bits/link.h deleted file mode 100644 index e69de29bb2..0000000000 --- a/sysdeps/hppa/bits/link.h +++ /dev/null diff --git a/sysdeps/hppa/bits/linkmap.h b/sysdeps/hppa/bits/linkmap.h deleted file mode 100644 index 54842b2299..0000000000 --- a/sysdeps/hppa/bits/linkmap.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Used to store the function descriptor table */ -struct link_map_machine - { - size_t fptr_table_len; - ElfW(Addr) *fptr_table; - }; diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h deleted file mode 100644 index d5ae7e7b5b..0000000000 --- a/sysdeps/hppa/bits/setjmp.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2000, 2005, 2006 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 the machine-dependent type `jmp_buf'. HPPA version. */ -#ifndef _BITS_SETJMP_H -#define _BITS_SETJMP_H 1 - -#if !defined _SETJMP_H && !defined _PTHREAD_H -# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." -#endif - -/* The previous bits/setjmp.h had __jmp_buf defined as a structure. - We use an array of 'double' instead, to make writing the assembler - easier, and to ensure proper alignment. Naturally, user code should - not depend on either representation. */ - -#ifndef _ASM -typedef double __jmp_buf[21]; -#endif - -#endif /* bits/setjmp.h */ diff --git a/sysdeps/hppa/bsd-_setjmp.S b/sysdeps/hppa/bsd-_setjmp.S deleted file mode 100644 index e5ec94c122..0000000000 --- a/sysdeps/hppa/bsd-_setjmp.S +++ /dev/null @@ -1,39 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. HPPA version. - Copyright (C) 2001, 2002 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 <sysdep.h> - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - - .text - .align 4 - .globl _setjmp - .export _setjmp, code - .level 2.0 - .proc - .callinfo - .import __sigsetjmp -_setjmp: - b __sigsetjmp - ldi 0, %r25 - - .procend -libc_hidden_def (_setjmp) diff --git a/sysdeps/hppa/bsd-setjmp.S b/sysdeps/hppa/bsd-setjmp.S deleted file mode 100644 index 04ddba4652..0000000000 --- a/sysdeps/hppa/bsd-setjmp.S +++ /dev/null @@ -1,36 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. HPPA version. - Copyright (C) 2001 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 just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - - .text - .align 4 - .globl setjmp - .export setjmp, code - .level 2.0 - .proc - .callinfo - .import __sigsetjmp -setjmp: - b __sigsetjmp - ldi 1, %r25 - - .procend diff --git a/sysdeps/hppa/configure b/sysdeps/hppa/configure deleted file mode 100755 index bc01e46b6c..0000000000 --- a/sysdeps/hppa/configure +++ /dev/null @@ -1,33 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - -echo "$as_me:$LINENO: checking for assembler line separator" >&5 -echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6 -if test "${libc_cv_asm_line_sep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <<EOF -nop ; is_old_puffin -EOF -if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_asm_line_sep='!' -else - if test -z "$enable_hacker_mode"; then - echo "*** You need a newer assembler to compile glibc" - rm -f conftest* - exit 1 - fi - libc_cv_asm_line_sep=';' -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $libc_cv_asm_line_sep" >&5 -echo "${ECHO_T}$libc_cv_asm_line_sep" >&6 -cat >>confdefs.h <<_ACEOF -#define ASM_LINE_SEP $libc_cv_asm_line_sep -_ACEOF - diff --git a/sysdeps/hppa/configure.in b/sysdeps/hppa/configure.in deleted file mode 100644 index 1ec417b947..0000000000 --- a/sysdeps/hppa/configure.in +++ /dev/null @@ -1,21 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. - -dnl The standard hppa assembler uses `;' to start comments and `!' -dnl as a line separator. -AC_CACHE_CHECK(for assembler line separator, - libc_cv_asm_line_sep, [dnl -cat > conftest.s <<EOF -nop ; is_old_puffin -EOF -if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_asm_line_sep='!' -else - if test -z "$enable_hacker_mode"; then - echo "*** You need a newer assembler to compile glibc" - rm -f conftest* - exit 1 - fi - libc_cv_asm_line_sep=';' -fi -rm -f conftest*]) -AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep) diff --git a/sysdeps/hppa/dl-fptr.h b/sysdeps/hppa/dl-fptr.h deleted file mode 100644 index 2ac9740e30..0000000000 --- a/sysdeps/hppa/dl-fptr.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Function descriptors. HPPA version. - Copyright (C) 2003 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 dl_hppa_fptr_h -#define dl_hppa_fptr_h 1 - -#include <sysdeps/generic/dl-fptr.h> - -/* There are currently 20 dynamic symbols in ld.so. - ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */ -#define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200 - -#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \ - asm (" addil LT%%" #symbol ", %%r19\n" \ - " ldw RT%%" #symbol "(%%sr0,%%r1), %0\n" \ - : "=&r" (var)); - - -#endif /* !dl_hppa_fptr_h */ diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h deleted file mode 100644 index 84436e7c56..0000000000 --- a/sysdeps/hppa/dl-lookupcfg.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Configuration of lookup functions. - Copyright (C) 2000, 2004 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 ELF_FUNCTION_PTR_IS_SPECIAL -#define DL_UNMAP_IS_SPECIAL - -/* Forward declaration. */ -struct link_map; - -void *_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref); - -#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref) - -Elf32_Addr _dl_lookup_address (const void *address); - -/* Clear the bottom two bits so generic code can find the fdesc entry */ -#define DL_LOOKUP_ADDRESS(addr) \ - (_dl_lookup_address ((void *)((unsigned long)addr & ~3))) - -void _dl_unmap (struct link_map *map); - -#define DL_UNMAP(map) _dl_unmap (map) - -#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \ -({ \ - unsigned int fptr[2]; \ - fptr[0] = (unsigned int) (addr); \ - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \ - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \ - (ElfW(Addr))((unsigned int)fptr | 2); \ -}) - -#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \ -({ \ - static unsigned int fptr[2]; \ - fptr[0] = (unsigned int) (addr); \ - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \ - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \ - (ElfW(Addr))((unsigned int)fptr | 2); \ -}) - - -/* The test for "addr & 2" below is to accomodate old binaries which - violated the ELF ABI by pointing DT_INIT and DT_FINI at a function - descriptor. */ -#define DL_DT_INIT_ADDRESS(map, addr) \ - ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr)) -#define DL_DT_FINI_ADDRESS(map, addr) \ - ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr)) diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h deleted file mode 100644 index d29501d306..0000000000 --- a/sysdeps/hppa/dl-machine.h +++ /dev/null @@ -1,762 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version. - Copyright (C) 1995-1997,1999-2003 - Free Software Foundation, Inc. - Contributed by David Huggins-Daines <dhd@debian.org> - 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 dl_machine_h -#define dl_machine_h 1 - -#define ELF_MACHINE_NAME "hppa" - -#include <sys/param.h> -#include <assert.h> -#include <string.h> -#include <link.h> -#include <errno.h> -#include <dl-fptr.h> -#include <abort-instr.h> - -# define VALID_ELF_OSABI(osabi) ((osabi == ELFOSABI_SYSV) || (osabi == ELFOSABI_LINUX)) -# define VALID_ELF_ABIVERSION(ver) (ver == 0) -# define VALID_ELF_HEADER(hdr,exp,size) \ - memcmp (hdr,exp,size-2) == 0 \ - && VALID_ELF_OSABI (hdr[EI_OSABI]) \ - && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION]) - -/* These two definitions must match the definition of the stub in - bfd/elf32-hppa.c (see plt_stub[]). - - a. Define the size of the *entire* stub we place at the end of the PLT - table (right up against the GOT). - - b. Define the number of bytes back from the GOT to the entry point of - the PLT stub. You see the PLT stub must be entered in the middle - so it can depwi to find it's own address (long jump stub) - - c. Define the size of a single PLT entry so we can jump over the - last entry to get the stub address */ - -#define SIZEOF_PLT_STUB (7*4) -#define GOT_FROM_PLT_STUB (4*4) -#define PLT_ENTRY_SIZE (2*4) - -/* Initialize the function descriptor table before relocations */ -static inline void -__hppa_init_bootstrap_fdesc_table (struct link_map *map) -{ - ElfW(Addr) *boot_table; - - /* Careful: this will be called before got has been relocated... */ - ELF_MACHINE_LOAD_ADDRESS(boot_table,_dl_boot_fptr_table); - - map->l_mach.fptr_table_len = ELF_MACHINE_BOOT_FPTR_TABLE_LEN; - map->l_mach.fptr_table = boot_table; -} - -#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \ - __hppa_init_bootstrap_fdesc_table (&bootstrap_map); - -/* Return nonzero iff ELF header is compatible with the running host. */ -static inline int -elf_machine_matches_host (const Elf32_Ehdr *ehdr) -{ - return ehdr->e_machine == EM_PARISC; -} - -/* Return the link-time address of _DYNAMIC. */ -static inline Elf32_Addr -elf_machine_dynamic (void) __attribute__ ((const)); - -static inline Elf32_Addr -elf_machine_dynamic (void) -{ - Elf32_Addr dynamic; - - asm ("b,l 1f,%0\n" -" depi 0,31,2,%0\n" -"1: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0\n" -" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0\n" - : "=r" (dynamic) : : "r1"); - - return dynamic; -} - -/* Return the run-time load address of the shared object. */ -static inline Elf32_Addr -elf_machine_load_address (void) __attribute__ ((const)); - -static inline Elf32_Addr -elf_machine_load_address (void) -{ - Elf32_Addr dynamic; - - asm ( -" b,l 1f,%0\n" -" depi 0,31,2,%0\n" -"1: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0\n" -" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%0\n" - : "=r" (dynamic) : : "r1"); - - return dynamic - elf_machine_dynamic (); -} - -/* Fixup a PLT entry to bounce directly to the function at VALUE. - Optimized non-profile version. */ -static inline Elf32_Addr -elf_machine_fixup_plt (struct link_map *map, lookup_t t, - const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr value) -{ - /* map is the link_map for the caller, t is the link_map for the object - being called */ - reloc_addr[1] = D_PTR (t, l_info[DT_PLTGOT]); - reloc_addr[0] = value; - /* Return the PLT slot rather than the function value so that the - trampoline can load the new LTP. */ - return (Elf32_Addr) reloc_addr; -} - -/* Fixup a PLT entry to bounce directly to the function at VALUE. */ -#define ELF_MACHINE_PROFILE_FIXUP_PLT elf_machine_profile_fixup_plt -static inline Elf32_Addr -elf_machine_profile_fixup_plt (struct link_map *map, lookup_t t, - const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr value) -{ - if(__builtin_expect (t == NULL, 1)) - return (Elf32_Addr) reloc_addr; - /* Return the PLT slot rather than the function value so that the - trampoline can load the new LTP. */ - return (Elf32_Addr) elf_machine_fixup_plt(map, t, reloc, reloc_addr, value); -} - -/* Return the final value of a plt relocation. */ -static inline Elf32_Addr -elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, - Elf32_Addr value) -{ - /* We are rela only */ - return value + reloc->r_addend; -} - -/* Set up the loaded object described by L so its unrelocated PLT - entries will jump to the on-demand fixup code in dl-runtime.c. */ - -static inline int -elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) -{ - Elf32_Addr *got = NULL; - Elf32_Addr l_addr, iplt, jmprel, end_jmprel, r_type, r_sym; - const Elf32_Rela *reloc; - struct fdesc *fptr; - static union { - unsigned char c[8]; - Elf32_Addr i[2]; - } sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}}; - - /* If we don't have a PLT we can just skip all this... */ - if (__builtin_expect (l->l_info[DT_JMPREL] == NULL,0)) - return lazy; - - /* All paths use these values */ - l_addr = l->l_addr; - jmprel = D_PTR(l, l_info[DT_JMPREL]); - end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val; - - extern void _dl_runtime_resolve (void); - extern void _dl_runtime_profile (void); - - /* Linking lazily */ - if (lazy) - { - /* FIXME: Search for the got, but backwards through the relocs, technically we should - find it on the first try. However, assuming the relocs got out of order the - routine is made a bit more robust by searching them all in case of failure. */ - for (iplt = (end_jmprel - sizeof(Elf32_Rela)); iplt >= jmprel; iplt -= sizeof (Elf32_Rela)) - { - - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB); - - /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */ - if (__builtin_expect (r_type != R_PARISC_IPLT, 0)) - { - if (__builtin_expect (r_type != R_PARISC_NONE, 0)) - _dl_reloc_bad_type (l, r_type, 1); - continue; - } - - /* Check for the plt_stub that binutils placed here for us - to use with _dl_runtime_resolve */ - if (got[-2] != sig.i[0] || got[-1] != sig.i[1]) - { - got = NULL; /* Not the stub... keep looking */ - } - else - { - /* Found the GOT! */ - register Elf32_Addr ltp __asm__ ("%r19"); - /* Identify this shared object. */ - got[1] = (Elf32_Addr) l; - - /* This function will be called to perform the relocation. */ - if (__builtin_expect (!profile, 1)) - { - /* If a static application called us, then _dl_runtime_resolve is not - a function descriptor, but the *real* address of the function... */ - if((unsigned long) &_dl_runtime_resolve & 3) - { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_resolve & ~3))->ip; - } - else - { - /* Static executable! */ - got[-2] = (Elf32_Addr) &_dl_runtime_resolve; - } - } - else - { - if (_dl_name_match_p (GLRO(dl_profile), l)) - { - /* This is the object we are looking for. Say that - we really want profiling and the timers are - started. */ - GL(dl_profile_map) = l; - } - - if((unsigned long) &_dl_runtime_resolve & 3) - { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_profile & ~3))->ip; - } - else - { - /* Static executable */ - got[-2] = (Elf32_Addr) &_dl_runtime_profile; - } - } - /* Plunk in the gp of this function descriptor so we - can make the call to _dl_runtime_xxxxxx */ - got[-1] = ltp; - break; - /* Done looking for the GOT, and stub is setup */ - } /* else we found the GOT */ - } /* for, walk the relocs backwards */ - - if(!got) - return 0; /* No lazy linking for you! */ - - /* Process all the relocs, now that we know the GOT... */ - for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) - { - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - if (__builtin_expect (r_type == R_PARISC_IPLT, 1)) - { - fptr = (struct fdesc *) (reloc->r_offset + l_addr); - if (r_sym != 0) - { - /* Relocate the pointer to the stub. */ - fptr->ip = (Elf32_Addr) got - GOT_FROM_PLT_STUB; - - /* Instead of the LTP value, we put the reloc offset - here. The trampoline code will load the proper - LTP and pass the reloc offset to the fixup - function. */ - fptr->gp = iplt - jmprel; - } /* r_sym != 0 */ - else - { - /* Relocate this *ABS* entry. */ - fptr->ip = reloc->r_addend + l_addr; - fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); - } - } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ - } /* if lazy */ - else - { - for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) - { - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1)) - { - fptr = (struct fdesc *) (reloc->r_offset + l_addr); - /* Relocate this *ABS* entry, set only the gp, the rest is set later - when elf_machine_rela_relative is called (WITHOUT the linkmap) */ - fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); - } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ - } - return lazy; -} - -/* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. */ - -#define RTLD_START \ -/* Set up dp for any non-PIC lib constructors that may be called. */ \ -static struct link_map * __attribute__((used)) \ -set_dp (struct link_map *map) \ -{ \ - register Elf32_Addr dp asm ("%r27"); \ - dp = D_PTR (map, l_info[DT_PLTGOT]); \ - asm volatile ("" : : "r" (dp)); \ - return map; \ -} \ - \ -asm ( \ -" .text\n" \ -" .globl _start\n" \ -" .type _start,@function\n" \ -"_start:\n" \ - /* The kernel does not give us an initial stack frame. */ \ -" ldo 64(%sp),%sp\n" \ - /* Save the relevant arguments (yes, those are the correct \ - registers, the kernel is weird) in their stack slots. */ \ -" stw %r25,-40(%sp)\n" /* argc */ \ -" stw %r24,-44(%sp)\n" /* argv */ \ - \ - /* We need the LTP, and we need it now. \ - $PIC_pcrel$0 points 8 bytes past the current instruction, \ - just like a branch reloc. This sequence gets us the \ - runtime address of _DYNAMIC. */ \ -" bl 0f,%r19\n" \ -" depi 0,31,2,%r19\n" /* clear priviledge bits */ \ -"0: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19\n" \ -" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26\n" \ - \ - /* The link time address is stored in the first entry of the \ - GOT. */ \ -" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19\n" \ -" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20\n" \ - \ -" sub %r26,%r20,%r20\n" /* Calculate load offset */ \ - \ - /* Rummage through the dynamic entries, looking for \ - DT_PLTGOT. */ \ -" ldw,ma 8(%r26),%r19\n" \ -"1: cmpib,=,n 3,%r19,2f\n" /* tag == DT_PLTGOT? */ \ -" cmpib,<>,n 0,%r19,1b\n" \ -" ldw,ma 8(%r26),%r19\n" \ - \ - /* Uh oh! We didn't find one. Abort. */ \ -" iitlbp %r0,(%r0)\n" \ - \ -"2: ldw -4(%r26),%r19\n" /* Found it, load value. */ \ -" add %r19,%r20,%r19\n" /* And add the load offset. */ \ - \ - /* Our initial stack layout is rather different from everyone \ - else's due to the unique PA-RISC ABI. As far as I know it \ - looks like this: \ - \ - ----------------------------------- (this frame created above) \ - | 32 bytes of magic | \ - |---------------------------------| \ - | 32 bytes argument/sp save area | \ - |---------------------------------| ((current->mm->env_end) \ - | N bytes of slack | + 63 & ~63) \ - |---------------------------------| \ - | envvar and arg strings | \ - |---------------------------------| \ - | ELF auxiliary info | \ - | (up to 28 words) | \ - |---------------------------------| \ - | Environment variable pointers | \ - | upwards to NULL | \ - |---------------------------------| \ - | Argument pointers | \ - | upwards to NULL | \ - |---------------------------------| \ - | argc (1 word) | \ - ----------------------------------- \ - \ - So, obviously, we can't just pass %sp to _dl_start. That's \ - okay, argv-4 will do just fine. \ - \ - The pleasant part of this is that if we need to skip \ - arguments we can just decrement argc and move argv, because \ - the stack pointer is utterly unrelated to the location of \ - the environment and argument vectors. */ \ - \ - /* This is always within range so we'll be okay. */ \ -" bl _dl_start,%rp\n" \ -" ldo -4(%r24),%r26\n" \ - \ -" .globl _dl_start_user\n" \ -" .type _dl_start_user,@function\n" \ -"_dl_start_user:\n" \ - /* Save the entry point in %r3. */ \ -" copy %ret0,%r3\n" \ - \ - /* Remember the lowest stack address. */ \ -" addil LT'__libc_stack_end,%r19\n" \ -" ldw RT'__libc_stack_end(%r1),%r20\n" \ -" stw %sp,0(%r20)\n" \ - \ - /* See if we were called as a command with the executable file \ - name as an extra leading argument. */ \ -" addil LT'_dl_skip_args,%r19\n" \ -" ldw RT'_dl_skip_args(%r1),%r20\n" \ -" ldw 0(%r20),%r20\n" \ - \ -" ldw -40(%sp),%r25\n" /* argc */ \ -" comib,= 0,%r20,.Lnofix\n" /* FIXME: Mispredicted branch */\ -" ldw -44(%sp),%r24\n" /* argv (delay slot) */ \ - \ -" sub %r25,%r20,%r25\n" \ -" stw %r25,-40(%sp)\n" \ -" sh2add %r20,%r24,%r24\n" \ -" stw %r24,-44(%sp)\n" \ - \ -".Lnofix:\n" \ -" addil LT'_rtld_local,%r19\n" \ -" ldw RT'_rtld_local(%r1),%r26\n" \ -" bl set_dp, %r2\n" \ -" ldw 0(%r26),%r26\n" \ - \ - /* Call _dl_init(_dl_loaded, argc, argv, envp). */ \ -" copy %r28,%r26\n" \ - \ - /* envp = argv + argc + 1 */ \ -" sh2add %r25,%r24,%r23\n" \ -" bl _dl_init_internal,%r2\n" \ -" ldo 4(%r23),%r23\n" /* delay slot */ \ - \ - /* Reload argc, argv to the registers start.S expects. */ \ -" ldw -40(%sp),%r25\n" \ -" ldw -44(%sp),%r24\n" \ - \ - /* _dl_fini does have a PLT slot now. I don't know how to get \ - to it though, so this hack will remain. */ \ -" .section .data\n" \ -"__dl_fini_plabel:\n" \ -" .word _dl_fini\n" \ -" .word 0xdeadbeef\n" \ -" .previous\n" \ - \ - /* %r3 contains a function pointer, we need to mask out the \ - lower bits and load the gp and jump address. */ \ -" depi 0,31,2,%r3\n" \ -" ldw 0(%r3),%r2\n" \ -" addil LT'__dl_fini_plabel,%r19\n" \ -" ldw RT'__dl_fini_plabel(%r1),%r23\n" \ -" stw %r19,4(%r23)\n" \ -" ldw 4(%r3),%r19\n" /* load the object's gp */ \ -" bv %r0(%r2)\n" \ -" depi 2,31,2,%r23\n" /* delay slot */ \ - ); - - -/* This code gets called via the .plt stub, and is used in - dl-runtime.c to call the `fixup' function and then redirect to the - address it returns. - - WARNING: This template is also used by gcc's __cffc, and expects - that the "bl" for fixup() exist at a particular offset. - Do not change this template without changing gcc, while the prefix - "bl" should fix everything so gcc finds the right spot, it will - slow down __cffc when it attempts to call fixup to resolve function - descriptor references. Please refer to gcc/gcc/config/pa/fptr.c - - Enter with r19 = reloc offset, r20 = got-8, r21 = fixup ltp. */ -#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \ - extern void tramp_name (void); \ - asm ( \ - " .text\n" \ - /* FAKE bl to provide gcc's __cffc with fixup's address */ \ - " bl " #fixup_name ",%r2\n" /* Runtime address of fixup */ \ - " .globl " #tramp_name "\n" \ - " .type " #tramp_name ",@function\n" \ - #tramp_name ":\n" \ - " .proc\n" \ - " .callinfo frame=64,calls,save_rp\n" \ - " .entry\n" \ - /* Save return pointer */ \ - " stw %r2,-20(%sp)\n" \ - /* Save argument registers in the call stack frame. */ \ - " stw %r26,-36(%sp)\n" \ - " stw %r25,-40(%sp)\n" \ - " stw %r24,-44(%sp)\n" \ - " stw %r23,-48(%sp)\n" \ - /* Build a call frame, and save structure pointer. */ \ - " stwm %r28,64(%sp)\n" \ - \ - /* Set up args to fixup func. */ \ - " ldw 8+4(%r20),%r26\n" /* (1) got[1] == struct link_map */ \ - " copy %r19,%r25\n" /* (2) reloc offset */ \ - " copy %r2,%r24\n" /* (3) profile_fixup needs rp */ \ - \ - /* Call the real address resolver. */ \ - " bl " #fixup_name ",%r2\n" \ - " copy %r21,%r19\n" /* set fixup func ltp (DELAY SLOT)*/ \ - \ - " ldw 0(%r28),%r22\n" /* load up the returned func ptr */ \ - " ldw 4(%r28),%r19\n" \ - " ldwm -64(%sp),%r28\n" \ - /* Arguments. */ \ - " ldw -36(%sp),%r26\n" \ - " ldw -40(%sp),%r25\n" \ - " ldw -44(%sp),%r24\n" \ - " ldw -48(%sp),%r23\n" \ - /* Call the real function. */ \ - " bv %r0(%r22)\n" \ - /* Return pointer. */ \ - " ldw -20(%sp),%r2\n" \ - " .exit\n" \ - " .procend\n"); - -#ifndef PROF -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ - TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \ - TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup); -#else -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ - TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \ - strong_alias (_dl_runtime_resolve, _dl_runtime_profile); -#endif - -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. - ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one - of the main executable's symbols, as for a COPY reloc. */ -#define elf_machine_type_class(type) \ - ((((type) == R_PARISC_IPLT || (type) == R_PARISC_EPLT) \ - * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_PARISC_COPY) * ELF_RTYPE_CLASS_COPY)) - -/* Used by the runtime in fixup to figure out if reloc is *really* PLT */ -#define ELF_MACHINE_JMP_SLOT R_PARISC_IPLT -#define ELF_MACHINE_SIZEOF_JMP_SLOT PLT_ENTRY_SIZE - -/* We only use RELA. */ -#define ELF_MACHINE_NO_REL 1 - -/* Return the address of the entry point. */ -#define ELF_MACHINE_START_ADDRESS(map, start) \ - DL_STATIC_FUNCTION_ADDRESS (map, start) - -/* We define an initialization functions. This is called very early in - * _dl_sysdep_start. */ -#define DL_PLATFORM_INIT dl_platform_init () - -static inline void __attribute__ ((unused)) -dl_platform_init (void) -{ - if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0') - /* Avoid an empty string which would disturb us. */ - GLRO(dl_platform) = NULL; -} - -#endif /* !dl_machine_h */ - -/* These are only actually used where RESOLVE_MAP is defined, anyway. */ -#ifdef RESOLVE_MAP - -auto void __attribute__((always_inline)) -elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, - const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) -{ - Elf32_Addr *const reloc_addr = reloc_addr_arg; - const Elf32_Sym *const refsym = sym; - unsigned long const r_type = ELF32_R_TYPE (reloc->r_info); - struct link_map *sym_map; - Elf32_Addr value; - -# if !defined RTLD_BOOTSTRAP && !defined SHARED - /* This is defined in rtld.c, but nowhere in the static libc.a; make the - reference weak so static programs can still link. This declaration - cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP) - because rtld.c contains the common defn for _dl_rtld_map, which is - incompatible with a weak decl in the same file. */ - weak_extern (GL(dl_rtld_map)); -# endif - - /* RESOLVE_MAP will return a null value for undefined syms, and - non-null for all other syms. In particular, relocs with no - symbol (symbol index of zero), also called *ABS* relocs, will be - resolved to MAP. (The first entry in a symbol table is all - zeros, and an all zero Elf32_Sym has a binding of STB_LOCAL.) - See RESOLVE_MAP definition in elf/dl-reloc.c */ -# ifdef RTLD_BOOTSTRAP - /* RESOLVE_MAP in rtld.c doesn't have the local sym test. */ - sym_map = (ELF32_ST_BIND (sym->st_info) != STB_LOCAL - ? RESOLVE_MAP (&sym, version, r_type) : map); -# else - sym_map = RESOLVE_MAP (&sym, version, r_type); -# endif - if (sym_map) - { - value = sym ? sym_map->l_addr + sym->st_value : 0; - value += reloc->r_addend; - } - else - value = 0; - - switch (r_type) - { - case R_PARISC_DIR32: - /* .eh_frame can have unaligned relocs. */ - if ((unsigned long) reloc_addr_arg & 3) - { - char *rel_addr = (char *) reloc_addr_arg; - rel_addr[0] = value >> 24; - rel_addr[1] = value >> 16; - rel_addr[2] = value >> 8; - rel_addr[3] = value; - return; - } - break; - - case R_PARISC_PLABEL32: - /* Easy rule: If there is a symbol and it is global, then we - need to make a dynamic function descriptor. Otherwise we - have the address of a PLT slot for a local symbol which we - know to be unique. */ - if (sym == NULL - || sym_map == NULL - || ELF32_ST_BIND (sym->st_info) == STB_LOCAL) - { - break; - } - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. - We have to do this outside of the generic function descriptor - code, since it doesn't know about our requirement for setting - protection bits */ - value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2); - break; - - case R_PARISC_IPLT: - if (__builtin_expect (sym_map != NULL, 1)) - { - elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, value); - } - else - { - /* If we get here, it's a (weak) undefined sym. */ - elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, value); - } - return; - - case R_PARISC_COPY: - if (__builtin_expect (sym == NULL, 0)) - /* This can happen in trace mode if an object could not be - found. */ - break; - if (__builtin_expect (sym->st_size > refsym->st_size, 0) - || (__builtin_expect (sym->st_size < refsym->st_size, 0) - && __builtin_expect (GLRO(dl_verbose), 0))) - { - const char *strtab; - - strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); - _dl_error_printf ("%s: Symbol `%s' has different size in shared object, " - "consider re-linking\n", - rtld_progname ?: "<program name unknown>", - strtab + refsym->st_name); - } - memcpy (reloc_addr_arg, (void *) value, - MIN (sym->st_size, refsym->st_size)); - return; - - case R_PARISC_NONE: /* Alright, Wilbur. */ - return; - - default: - _dl_reloc_bad_type (map, r_type, 0); - } - - *reloc_addr = value; -} - -/* hppa doesn't have an R_PARISC_RELATIVE reloc, but uses relocs with - ELF32_R_SYM (info) == 0 for a similar purpose. */ -auto void __attribute__((always_inline)) -elf_machine_rela_relative (Elf32_Addr l_addr, - const Elf32_Rela *reloc, - void *const reloc_addr_arg) -{ - unsigned long const r_type = ELF32_R_TYPE (reloc->r_info); - Elf32_Addr *const reloc_addr = reloc_addr_arg; - static char msgbuf[] = { "Unknown" }; - struct link_map map; - Elf32_Addr value; - - value = l_addr + reloc->r_addend; - - if (ELF32_R_SYM (reloc->r_info) != 0){ - _dl_error_printf ("%s: In elf_machine_rela_relative " - "ELF32_R_SYM (reloc->r_info) != 0. Aborting.", - rtld_progname ?: "<program name unknown>"); - ABORT_INSTRUCTION; /* Crash. */ - } - - switch (r_type) - { - case R_PARISC_DIR32: - /* .eh_frame can have unaligned relocs. */ - if ((unsigned long) reloc_addr_arg & 3) - { - char *rel_addr = (char *) reloc_addr_arg; - rel_addr[0] = value >> 24; - rel_addr[1] = value >> 16; - rel_addr[2] = value >> 8; - rel_addr[3] = value; - return; - } - break; - - case R_PARISC_PLABEL32: - break; - - case R_PARISC_IPLT: /* elf_machine_runtime_setup already set gp */ - break; - - case R_PARISC_NONE: - return; - - default: /* Bad reloc, map unknown (really it's the current map) */ - map.l_name = msgbuf; - _dl_reloc_bad_type (&map, r_type, 0); - return; - } - - *reloc_addr = value; -} - -auto void __attribute__((always_inline)) -elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) -{ - /* We don't have anything to do here. elf_machine_runtime_setup has - done all the relocs already. */ -} - -#endif /* RESOLVE_MAP */ diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c deleted file mode 100644 index e5ce6a9c03..0000000000 --- a/sysdeps/hppa/dl-symaddr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Get the symbol address. HPPA version. - Copyright (C) 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. */ - -#include <ldsodefs.h> -#include <dl-machine.h> - -void * -_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref) -{ - /* Find the "ip" from the "map" and symbol "ref" */ - Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value; - - /* On hppa, we have to return the pointer to function descriptor. - This involves an "| 2" to inform $$dyncall that this is a plabel32 */ - if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC){ - return (void *)((unsigned long)_dl_make_fptr (map, ref, value) | 2); - } - else - return (void *) value; -} diff --git a/sysdeps/hppa/elf/entry.h b/sysdeps/hppa/elf/entry.h deleted file mode 100644 index b024db2be7..0000000000 --- a/sysdeps/hppa/elf/entry.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __ASSEMBLY__ -extern void _start (void); -#endif - -/* The function's entry point is stored in the first word of the - function descriptor (plabel) of _start(). */ -#define ENTRY_POINT __canonicalize_funcptr_for_compare(_start) - -/* We have to provide a special declaration. */ -#define ENTRY_POINT_DECL(class) class void _start (void); diff --git a/sysdeps/hppa/elf/initfini.c b/sysdeps/hppa/elf/initfini.c deleted file mode 100644 index 35f5dd52fe..0000000000 --- a/sysdeps/hppa/elf/initfini.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Special .init and .fini section support for HPPA - Copyright (C) 2000, 2002 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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 is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the - .init and .fini sections and defines global symbols for - those addresses, so they can be called as functions. - - * crtn.s puts the corresponding function epilogues - in the .init and .fini sections. */ - -/* If we use the standard C version, the linkage table pointer won't - be properly preserved due to the splitting up of function prologues - and epilogues. Therefore we write these in assembly to make sure - they do the right thing. - - Note that we cannot have a weak undefined __gmon_start__, because - that would require this to be PIC, and the linker is currently not - able to generate a proper procedure descriptor for _init. Sad but - true. Anyway, HPPA is one of those horrible architectures where - making the comparison and indirect call is quite expensive (see the - comment in sysdeps/generic/initfini.c). */ - -__asm__ ("\ -\n\ -#include \"defs.h\"\n\ -\n\ -/*@HEADER_ENDS*/\n\ -\n\ -/*@_init_PROLOG_BEGINS*/\n\ - .section .init\n\ - .align 4\n\ - .globl _init\n\ - .type _init,@function\n\ -_init:\n\ - stw %rp,-20(%sp)\n\ - stwm %r4,64(%sp)\n\ - stw %r19,-32(%sp)\n\ - bl __gmon_start__,%rp\n\ - copy %r19,%r4 /* delay slot */\n\ - copy %r4,%r19\n\ -/*@_init_PROLOG_ENDS*/\n\ -\n\ -/*@_init_EPILOG_BEGINS*/\n\ - .text\n\ - .align 4\n\ - .weak __gmon_start__\n\ - .type __gmon_start__,@function\n\ -__gmon_start__:\n\ - .proc\n\ - .callinfo\n\ - .entry\n\ - bv,n %r0(%r2)\n\ - .exit\n\ - .procend\n\ -\n\ -/* Here is the tail end of _init. We put __gmon_start before this so\n\ - that the assembler creates the .PARISC.unwind section for us, ie.\n\ - with the right attributes. */\n\ - .section .init\n\ - ldw -84(%sp),%rp\n\ - copy %r4,%r19\n\ - bv %r0(%rp)\n\ -_end_init:\n\ - ldwm -64(%sp),%r4\n\ -\n\ -/* Our very own unwind info, because the assembler can't handle\n\ - functions split into two or more pieces. */\n\ - .section .PARISC.unwind\n\ - .extern _init\n\ - .word _init, _end_init\n\ - .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\ -\n\ -/*@_init_EPILOG_ENDS*/\n\ -\n\ -/*@_fini_PROLOG_BEGINS*/\n\ - .section .fini\n\ - .align 4\n\ - .globl _fini\n\ - .type _fini,@function\n\ -_fini:\n\ - stw %rp,-20(%sp)\n\ - stwm %r4,64(%sp)\n\ - stw %r19,-32(%sp)\n\ - copy %r19,%r4\n\ -/*@_fini_PROLOG_ENDS*/\n\ -\n\ -/*@_fini_EPILOG_BEGINS*/\n\ - .section .fini\n\ - ldw -84(%sp),%rp\n\ - copy %r4,%r19\n\ - bv %r0(%rp)\n\ -_end_fini:\n\ - ldwm -64(%sp),%r4\n\ -\n\ - .section .PARISC.unwind\n\ - .extern _fini\n\ - .word _fini, _end_fini\n\ - .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\ -\n\ -/*@_fini_EPILOG_ENDS*/\n\ -\n\ -/*@TRAILER_BEGINS*/\ -"); diff --git a/sysdeps/hppa/elf/start.S b/sysdeps/hppa/elf/start.S deleted file mode 100644 index 94edeaa212..0000000000 --- a/sysdeps/hppa/elf/start.S +++ /dev/null @@ -1,121 +0,0 @@ -/* ELF startup code for HPPA. - Copyright (C) 2002 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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. */ - - .import main, code - .import $global$, data - .import __libc_start_main, code - .import __libc_csu_fini, code - .import __libc_csu_init, code - - /* Have the linker create plabel words - so we get PLABEL32 relocs and not 21/14 */ - .section .rodata - .align 4 -.Lpmain: - .word P%main -.Lp__libc_start_main: - .word P%__libc_start_main -.Lp__libc_csu_fini: - .word P%__libc_csu_fini -.Lp__libc_csu_init: - .word P%__libc_csu_init - - .text - .align 4 - .globl _start - .export _start, ENTRY - .type _start,@function -_start: - - .proc - .callinfo - - /* Expand the stack to store the 5th through 7th args */ - ldo 64(%sp), %sp - /* TODO: Follow ABI? Place more things on the stack here... */ - -#if SHARED - /* load main (1st argument) */ - addil LR'.Lpmain, %r19 - ldw RR'.Lpmain(%r1), %r26 - ldw 0(%r26),%r26 - /* argc and argv should be in 25 and 24 (2nd and 3rd argument) */ - /* void (*init) (void) (4th argument) */ - addil LR'.Lp__libc_csu_init, %r19 - ldw RR'.Lp__libc_csu_init(%r1), %r23 - ldw 0(%r23), %r23 - /* void (*fini) (void) (5th argument) */ - addil LR'.Lp__libc_csu_fini, %r19 - ldw RR'.Lp__libc_csu_fini(%r1), %r22 - ldw 0(%r22), %r22 -#else - /* load main (1st argument) */ - ldil LR'.Lpmain, %r26 - ldw RR'.Lpmain(%r26), %r26 - /* argc and argv should be in 25 and 24 (2nd and 3rd argument) */ - /* void (*init) (void) (4th argument) */ - ldil LR'.Lp__libc_csu_init, %r23 - ldw RR'.Lp__libc_csu_init(%r23), %r23 - /* void (*fini) (void) (5th argument) */ - ldil LR'.Lp__libc_csu_fini, %r22 - ldw RR'.Lp__libc_csu_fini(%r22), %r22 -#endif - /* Store 5th argument */ - stw %r22, -52(%sp) - /* void (*rtld_fini) (void) (6th argument) */ - stw %r23, -56(%sp) - /* void *stack_end (7th argument) */ - stw %sp, -60(%sp) - - /* load global */ - ldil L%$global$, %dp - ldo R%$global$(%dp), %dp - - bl __libc_start_main,%r2 - nop - /* die horribly if it returned (it shouldn't) */ - iitlbp %r0,(%sr0,%r0) - nop - - .procend - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h deleted file mode 100644 index c5f8c43459..0000000000 --- a/sysdeps/hppa/fpu/bits/fenv.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org> - - 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 <bits/fenv.h> directly; include <fenv.h> instead." -#endif - -/* Define bits representing the exception. We use the values of the - appropriate enable bits in the FPU status word (which, - coincidentally, are the same as the flag bits, but shifted right by - 27 bits). */ -enum -{ - FE_INVALID = 1<<4, /* V */ -#define FE_INVALID FE_INVALID - FE_DIVBYZERO = 1<<3, /* Z */ -#define FE_DIVBYZERO FE_DIVBYZERO - FE_OVERFLOW = 1<<2, /* O */ -#define FE_OVERFLOW FE_OVERFLOW - FE_UNDERFLOW = 1<<1, /* U */ -#define FE_UNDERFLOW FE_UNDERFLOW - FE_INEXACT = 1<<0, /* I */ -#define FE_INEXACT FE_INEXACT -}; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The PA-RISC FPU supports all of the four defined rounding modes. - We use the values of the RM field in the floating point status - register for the appropriate macros. */ -enum - { - FE_TONEAREST = 0 << 9, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDZERO = 1 << 9, -#define FE_TOWARDZERO FE_TOWARDZERO - FE_UPWARD = 2 << 9, -#define FE_UPWARD FE_UPWARD - FE_DOWNWARD = 3 << 9, -#define FE_DOWNWARD FE_DOWNWARD - }; - -/* Type representing exception flags. */ -typedef unsigned int fexcept_t; - -/* Type representing floating-point environment. This structure - corresponds to the layout of the status and exception words in the - register file. */ -typedef struct -{ - unsigned int __status_word; - unsigned int __exception[7]; -} fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exceptions are masked. */ -# define FE_NOMASK_ENV ((fenv_t *) -2) -#endif diff --git a/sysdeps/hppa/fpu/fclrexcpt.c b/sysdeps/hppa/fpu/fclrexcpt.c deleted file mode 100644 index a7c698206e..0000000000 --- a/sysdeps/hppa/fpu/fclrexcpt.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -feclearexcept (int excepts) -{ - unsigned int sw[2]; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - /* Clear all the relevant bits. */ - sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27); - __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); - - /* Success. */ - return 0; -} diff --git a/sysdeps/hppa/fpu/fedisblxcpt.c b/sysdeps/hppa/fpu/fedisblxcpt.c deleted file mode 100644 index aac6bbfa2a..0000000000 --- a/sysdeps/hppa/fpu/fedisblxcpt.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -fedisableexcept (int excepts) -{ - unsigned int sw[2], old_exc; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - old_exc = sw[0] & FE_ALL_EXCEPT; - - sw[0] &= ~(excepts & FE_ALL_EXCEPT); - __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); - - return old_exc; -} diff --git a/sysdeps/hppa/fpu/feenablxcpt.c b/sysdeps/hppa/fpu/feenablxcpt.c deleted file mode 100644 index 9ce3ca82cc..0000000000 --- a/sysdeps/hppa/fpu/feenablxcpt.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -feenableexcept (int excepts) -{ - unsigned int sw[2], old_exc; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - old_exc = sw[0] & FE_ALL_EXCEPT; - - sw[0] |= (excepts & FE_ALL_EXCEPT); - __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); - - return old_exc; -} diff --git a/sysdeps/hppa/fpu/fegetenv.c b/sysdeps/hppa/fpu/fegetenv.c deleted file mode 100644 index b87317b789..0000000000 --- a/sysdeps/hppa/fpu/fegetenv.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Store current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -fegetenv (fenv_t *envp) -{ - __asm__ ( - "fstd,ma %%fr0,8(%1)\n" - "fstd,ma %%fr1,8(%1)\n" - "fstd,ma %%fr2,8(%1)\n" - "fstd %%fr3,0(%1)\n" - : "=m" (*envp), "+r" (envp)); - return 0; -} diff --git a/sysdeps/hppa/fpu/fegetexcept.c b/sysdeps/hppa/fpu/fegetexcept.c deleted file mode 100644 index efd1d7df05..0000000000 --- a/sysdeps/hppa/fpu/fegetexcept.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -fegetexcept (void) -{ - unsigned int sw[2]; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - return sw[0] & FE_ALL_EXCEPT; -} diff --git a/sysdeps/hppa/fpu/feholdexcpt.c b/sysdeps/hppa/fpu/feholdexcpt.c deleted file mode 100644 index 5aec0151f8..0000000000 --- a/sysdeps/hppa/fpu/feholdexcpt.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Store current floating-point environment and clear exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> -#include <string.h> - -int -feholdexcept (fenv_t *envp) -{ - fenv_t clear; - fenv_t * _regs = envp; - - /* Store the environment. */ - __asm__ ( - "fstd,ma %%fr0,8(%1)\n" - "fstd,ma %%fr1,8(%1)\n" - "fstd,ma %%fr2,8(%1)\n" - "fstd %%fr3,0(%1)\n" - : "=m" (*_regs), "+r" (_regs)); - memcpy (&clear, envp, sizeof (clear)); - - /* Now clear all exceptions. */ - clear.__status_word &= ~(FE_ALL_EXCEPT << 27); - memset (clear.__exception, 0, sizeof (clear.__exception)); - - /* And set all exceptions to non-stop. */ - clear.__status_word &= ~FE_ALL_EXCEPT; - - /* Load the new environment. */ - _regs = &clear; - __asm__ ( - "fldd,ma 8(%0),%%fr0\n" - "fldd,ma 8(%0),%%fr1\n" - "fldd,ma 8(%0),%%fr2\n" - "fldd 0(%0),%%fr3\n" - : : "r" (_regs)); - - return 0; -} diff --git a/sysdeps/hppa/fpu/fesetenv.c b/sysdeps/hppa/fpu/fesetenv.c deleted file mode 100644 index 526773214b..0000000000 --- a/sysdeps/hppa/fpu/fesetenv.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - Based on the m68k version by - Andreas Schwab <schwab@suse.de> - - 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 <fenv.h> - -int -fesetenv (const fenv_t *envp) -{ - fenv_t temp; - fenv_t * _regs = &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__ ( - "fstd,ma %%fr0,8(%1)\n" - "fstd,ma %%fr1,8(%1)\n" - "fstd,ma %%fr2,8(%1)\n" - "fstd %%fr3,0(%1)\n" - : "=m" (*_regs), "+r" (_regs)); - - temp.__status_word &= ~(FE_ALL_EXCEPT - | (FE_ALL_EXCEPT << 27) - | FE_DOWNWARD); - if (envp == FE_DFL_ENV) - ; - else if (envp == FE_NOMASK_ENV) - temp.__status_word |= FE_ALL_EXCEPT; - else - temp.__status_word |= (envp->__status_word - & (FE_ALL_EXCEPT - | FE_DOWNWARD - | (FE_ALL_EXCEPT << 27))); - - /* Load the new environment. */ - __asm__ ( - "fldd,ma -8(%1),%%fr3\n" - "fldd,ma -8(%1),%%fr2\n" - "fldd,ma -8(%1),%%fr1\n" - "fldd 0(%1),%%fr0\n" - : "=m" (*_regs), "+r" (_regs)); - - /* Success. */ - return 0; -} -libm_hidden_def (fesetenv) diff --git a/sysdeps/hppa/fpu/fesetround.c b/sysdeps/hppa/fpu/fesetround.c deleted file mode 100644 index 3687624c2b..0000000000 --- a/sysdeps/hppa/fpu/fesetround.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -fesetround (int round) -{ - unsigned int sw[2]; - - if (round & ~FE_DOWNWARD) - /* ROUND is not a valid rounding mode. */ - return 1; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - sw[0] &= ~FE_DOWNWARD; - sw[0] |= round; - __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); - - return 0; -} diff --git a/sysdeps/hppa/fpu/feupdateenv.c b/sysdeps/hppa/fpu/feupdateenv.c deleted file mode 100644 index 7d50282e05..0000000000 --- a/sysdeps/hppa/fpu/feupdateenv.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -feupdateenv (const fenv_t *envp) -{ - unsigned int sw[2]; - - /* Get the current exception status. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - /* Install new environment. */ - fesetenv (envp); - /* Raise the saved exceptions */ - feraiseexcept(sw[0] & FE_ALL_EXCEPT); - - /* Success. */ - return 0; -} diff --git a/sysdeps/hppa/fpu/fgetexcptflg.c b/sysdeps/hppa/fpu/fgetexcptflg.c deleted file mode 100644 index 27766ecf58..0000000000 --- a/sysdeps/hppa/fpu/fgetexcptflg.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> - -int -fegetexceptflag (fexcept_t *flagp, int excepts) -{ - unsigned int sw[2]; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - *flagp = (sw[0] >> 27) & excepts & FE_ALL_EXCEPT; - - /* Success. */ - return 0; -} - diff --git a/sysdeps/hppa/fpu/fraiseexcpt.c b/sysdeps/hppa/fpu/fraiseexcpt.c deleted file mode 100644 index b064dc1527..0000000000 --- a/sysdeps/hppa/fpu/fraiseexcpt.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org> - - 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 <fenv.h> -#include <float.h> -#include <math.h> - -/* Please see section 10, - page 10-5 "Delayed Trapping" in the PA-RISC 2.0 Architecture manual */ - -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. */ - - /* We do these bits in assembly to be certain GCC doesn't optimize - away something important, and so we can force delayed traps to - occur. */ - - /* We use "fldd 0(%%sr0,%%sp),%0" to flush the delayed exception */ - - /* First: Invalid exception. */ - if (excepts & FE_INVALID) - { - /* One example of a invalid operation is 0 * Infinity. */ - double d = HUGE_VAL; - __asm__ __volatile__ ( - " fcpy,dbl %%fr0,%%fr22\n" - " fmpy,dbl %0,%%fr22,%0\n" - " fldd 0(%%sr0,%%sp),%0" - : "+f" (d) : : "%fr22" ); - } - - /* Second: Division by zero. */ - if (excepts & FE_DIVBYZERO) - { - double d = 1.0; - __asm__ __volatile__ ( - " fcpy,dbl %%fr0,%%fr22\n" - " fdiv,dbl %0,%%fr22,%0\n" - " fldd 0(%%sr0,%%sp),%0" - : "+f" (d) : : "%fr22" ); - } - - /* Third: Overflow. */ - if (excepts & FE_OVERFLOW) - { - double d = DBL_MAX; - __asm__ __volatile__ ( - " fadd,dbl %0,%0,%0\n" - " fldd 0(%%sr0,%%sp),%0" - : "+f" (d) ); - } - - /* Fourth: Underflow. */ - if (excepts & FE_UNDERFLOW) - { - double d = DBL_MIN; - double e = 3.0; - __asm__ __volatile__ ( - " fdiv,dbl %0,%1,%0\n" - " fldd 0(%%sr0,%%sp),%0" - : "+f" (d) : "f" (e) ); - } - - /* Fifth: Inexact */ - if (excepts & FE_INEXACT) - { - double d = M_PI; - double e = 69.69; - __asm__ __volatile__ ( - " fdiv,dbl %0,%1,%%fr22\n" - " fcnvfxt,dbl,sgl %%fr22,%%fr22L\n" - " fldd 0(%%sr0,%%sp),%%fr22" - : : "f" (d), "f" (e) : "%fr22" ); - } - - /* Success. */ - return 0; -} -libm_hidden_def (feraiseexcept) diff --git a/sysdeps/hppa/fpu/fsetexcptflg.c b/sysdeps/hppa/fpu/fsetexcptflg.c deleted file mode 100644 index af35f5ae35..0000000000 --- a/sysdeps/hppa/fpu/fsetexcptflg.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 - - 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 <fenv.h> -#include <math.h> - -int -fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - unsigned int sw[2]; - - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - - /* Install new enable trap bits */ - sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27; - - /* Store the new status word. */ - __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); - - /* Success. */ - return 0; -} diff --git a/sysdeps/hppa/fpu/libm-test-ulps b/sysdeps/hppa/fpu/libm-test-ulps deleted file mode 100644 index b514496676..0000000000 --- a/sysdeps/hppa/fpu/libm-test-ulps +++ /dev/null @@ -1,890 +0,0 @@ -# Begin of automatic generation - -# atan2 -Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": -float: 1 -ifloat: 1 - -# atanh -Test "atanh (0.75) == 0.972955074527656652552676371721589865": -float: 1 -ifloat: 1 - -# cacosh -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -# casin -Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# casinh -Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 -Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 -Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# catan -Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -float: 3 -ifloat: 3 -Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i": -float: 4 -ifloat: 4 - -# catanh -Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -double: 4 -idouble: 4 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -float: 4 -ifloat: 4 -Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -double: 1 -idouble: 1 -Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -float: 6 -ifloat: 6 - -# cbrt -Test "cbrt (-27.0) == -3.0": -double: 1 -idouble: 1 -Test "cbrt (0.75) == 0.908560296416069829445605878163630251": -double: 1 -idouble: 1 -Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217": -double: 1 -idouble: 1 - -# ccos -Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": -float: 1 -ifloat: 1 -Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -float: 1 -ifloat: 1 - -# ccosh -Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -float: 1 -ifloat: 1 - -# cexp -Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": -float: 1 -ifloat: 1 -Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -float: 1 -ifloat: 1 - -# clog -Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i": -float: 3 -ifloat: 3 -Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -float: 1 -ifloat: 1 - -# clog10 -Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": -float: 1 -ifloat: 1 - -# cos -Test "cos (M_PI_6l * 2.0) == 0.5": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "cos (M_PI_6l * 4.0) == -0.5": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "cos (pi/2) == 0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# cpow -Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": -double: 2 -float: 3 -idouble: 2 -ifloat: 3 -Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -float: 2 -ifloat: 2 -Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -# csinh -Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": -double: 1 -idouble: 1 -Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 - -# csqrt -Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 -Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 - -# ctan -Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": -double: 1 -idouble: 1 -Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -double: 1 -idouble: 1 - -# ctanh -Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": -float: 1 -ifloat: 1 -Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": -double: 1 -idouble: 1 - -# erf -Test "erf (1.25) == 0.922900128256458230136523481197281140": -double: 1 -idouble: 1 - -# erfc -Test "erfc (2.0) == 0.00467773498104726583793074363274707139": -double: 1 -idouble: 1 -Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": -double: 1 -idouble: 1 - -# exp10 -Test "exp10 (-1) == 0.1": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "exp10 (0.75) == 5.62341325190349080394951039776481231": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "exp10 (3) == 1000": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -# expm1 -Test "expm1 (0.75) == 1.11700001661267466854536981983709561": -double: 1 -idouble: 1 -Test "expm1 (1) == M_El - 1.0": -float: 1 -ifloat: 1 - -# hypot -Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 - -# j0 -Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "j0 (10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "j0 (2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 - -# j1 -Test "j1 (10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "j1 (2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "j1 (8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 - -# jn -Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 -Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 -Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": -double: 4 -float: 3 -idouble: 4 -ifloat: 3 -Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": -float: 4 -ifloat: 4 -Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# lgamma -Test "lgamma (0.7) == 0.260867246531666514385732417016759578": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# log10 -Test "log10 (0.75) == -0.124938736608299953132449886193870744": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "log10 (e) == log10(e)": -float: 1 -ifloat: 1 - -# log1p -Test "log1p (-0.25) == -0.287682072451780927439219005993827432": -float: 1 -ifloat: 1 - -# sincos -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": -float: 1 -ifloat: 1 - -# tan -Test "tan (pi/4) == 1": -double: 1 -idouble: 1 - -# tgamma -Test "tgamma (-0.5) == -2 sqrt (pi)": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "tgamma (0.5) == sqrt (pi)": -float: 1 -ifloat: 1 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y0 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "y0 (8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y1 -Test "y1 (0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "y1 (1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "y1 (10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "y1 (2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "y1 (8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# yn -Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "yn (1, 1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "yn (10, 0.125) == -127057845771019398.252538486899753195": -double: 1 -idouble: 1 -Test "yn (10, 0.75) == -2133501638.90573424452445412893839236": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 1.0) == -121618014.278689189288130426667971145": -double: 1 -idouble: 1 -Test "yn (10, 10.0) == -0.359814152183402722051986577343560609": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 2.0) == -129184.542208039282635913145923304214": -double: 2 -idouble: 2 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": -double: 1 -idouble: 1 -Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": -double: 1 -idouble: 1 - -# Maximal error of functions: -Function: "atan2": -float: 3 -ifloat: 3 - -Function: "atanh": -float: 1 -ifloat: 1 - -Function: Real part of "cacosh": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 - -Function: Imaginary part of "cacosh": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -Function: Real part of "casin": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "casinh": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 - -Function: Imaginary part of "casinh": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 - -Function: Real part of "catan": -float: 4 -ifloat: 4 - -Function: Imaginary part of "catan": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "catanh": -double: 4 -idouble: 4 - -Function: Imaginary part of "catanh": -float: 6 -ifloat: 6 - -Function: "cbrt": -double: 1 -idouble: 1 - -Function: Real part of "ccos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccos": -float: 1 -ifloat: 1 - -Function: Real part of "ccosh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccosh": -float: 1 -ifloat: 1 - -Function: Real part of "cexp": -float: 1 -ifloat: 1 - -Function: Imaginary part of "cexp": -float: 1 -ifloat: 1 - -Function: Real part of "clog": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog": -float: 3 -ifloat: 3 - -Function: Real part of "clog10": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog10": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 - -Function: "cos": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: Real part of "cpow": -double: 2 -float: 4 -idouble: 2 -ifloat: 4 - -Function: Imaginary part of "cpow": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: Real part of "csinh": -float: 1 -ifloat: 1 - -Function: Imaginary part of "csinh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "csqrt": -float: 1 -ifloat: 1 - -Function: Real part of "ctan": -double: 1 -idouble: 1 - -Function: Imaginary part of "ctan": -double: 1 -idouble: 1 - -Function: Real part of "ctanh": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: Imaginary part of "ctanh": -float: 1 -ifloat: 1 - -Function: "erf": -double: 1 -idouble: 1 - -Function: "erfc": -double: 1 -idouble: 1 - -Function: "exp10": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -Function: "expm1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "hypot": -float: 1 -ifloat: 1 - -Function: "j0": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: "j1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "jn": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 - -Function: "lgamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log10": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log1p": -float: 1 -ifloat: 1 - -Function: "sincos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "tan": -double: 1 -idouble: 1 - -Function: "tgamma": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "y0": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: "y1": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -Function: "yn": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -# end of automatic generation diff --git a/sysdeps/hppa/frame.h b/sysdeps/hppa/frame.h deleted file mode 100644 index 0a234f1aa7..0000000000 --- a/sysdeps/hppa/frame.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Definition of stack frame structure. HPPA version. - Copyright (C) 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. */ - -/* PA stacks grow upwards. */ -#define INNER_THAN > - -/* FIXME: will verify this later */ -struct layout -{ - void *next; - void *return_address; -}; diff --git a/sysdeps/hppa/gccframe.h b/sysdeps/hppa/gccframe.h deleted file mode 100644 index 65e44dfd73..0000000000 --- a/sysdeps/hppa/gccframe.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Definition of object in frame unwind info. hppa version. - Copyright (C) 2001 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. */ - -/* Note: For hppa64 this is 61 */ -#define DWARF_FRAME_REGISTERS 89 - -#include <sysdeps/generic/gccframe.h> diff --git a/sysdeps/hppa/hppa1.1/Implies b/sysdeps/hppa/hppa1.1/Implies deleted file mode 100644 index 5f935a299c..0000000000 --- a/sysdeps/hppa/hppa1.1/Implies +++ /dev/null @@ -1,4 +0,0 @@ -wordsize-32 -ieee754/flt-32 -ieee754/dbl-64 -ieee754/ldbl-128 diff --git a/sysdeps/hppa/hppa1.1/addmul_1.s b/sysdeps/hppa/hppa1.1/addmul_1.s deleted file mode 100644 index a1fb083a83..0000000000 --- a/sysdeps/hppa/hppa1.1/addmul_1.s +++ /dev/null @@ -1,104 +0,0 @@ -;! HP-PA-1.1 __mpn_addmul_1 -- Multiply a limb vector with a limb and -;! add the result to a second limb vector. - -;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr r26 -;! s1_ptr r25 -;! size r24 -;! s2_limb r23 - -;! This runs at 11 cycles/limb on a PA7000. With the used instructions, it -;! can not become faster due to data cache contention after a store. On the -;! PA7100 it runs at 10 cycles/limb, and that can not be improved either, -;! since only the xmpyu does not need the integer pipeline, so the only -;! dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb -;! on the PA7100. - -;! There are some ideas described in mul_1.s that applies to this code too. - - .text - .export __mpn_addmul_1 -__mpn_addmul_1: - .proc - .callinfo frame=64,no_calls - .entry - - ldo 64(%r30),%r30 - fldws,ma 4(%r25),%fr5 - stw %r23,-16(%r30) ;! move s2_limb ... - addib,= -1,%r24,L$just_one_limb - fldws -16(%r30),%fr4 ;! ... into fr4 - add %r0,%r0,%r0 ;! clear carry - xmpyu %fr4,%fr5,%fr6 - fldws,ma 4(%r25),%fr7 - fstds %fr6,-16(%r30) - xmpyu %fr4,%fr7,%fr8 - ldw -12(%r30),%r20 ;! least significant limb in product - ldw -16(%r30),%r28 - - fstds %fr8,-16(%r30) - addib,= -1,%r24,L$end - ldw -12(%r30),%r1 - -;! Main loop -L$loop: - ldws 0(%r26),%r29 - fldws,ma 4(%r25),%fr5 - add %r29,%r20,%r20 - stws,ma %r20,4(%r26) - addc %r28,%r1,%r20 - xmpyu %fr4,%fr5,%fr6 - ldw -16(%r30),%r28 - fstds %fr6,-16(%r30) - addc %r0,%r28,%r28 - addib,<> -1,%r24,L$loop - ldw -12(%r30),%r1 - -L$end: - ldw 0(%r26),%r29 - add %r29,%r20,%r20 - stws,ma %r20,4(%r26) - addc %r28,%r1,%r20 - ldw -16(%r30),%r28 - ldws 0(%r26),%r29 - addc %r0,%r28,%r28 - add %r29,%r20,%r20 - stws,ma %r20,4(%r26) - addc %r0,%r28,%r28 - bv 0(%r2) - ldo -64(%r30),%r30 - -L$just_one_limb: - xmpyu %fr4,%fr5,%fr6 - ldw 0(%r26),%r29 - fstds %fr6,-16(%r30) - ldw -12(%r30),%r1 - ldw -16(%r30),%r28 - add %r29,%r1,%r20 - stw %r20,0(%r26) - addc %r0,%r28,%r28 - bv 0(%r2) - ldo -64(%r30),%r30 - - .exit - .procend diff --git a/sysdeps/hppa/hppa1.1/mul_1.s b/sysdeps/hppa/hppa1.1/mul_1.s deleted file mode 100644 index 00c770f272..0000000000 --- a/sysdeps/hppa/hppa1.1/mul_1.s +++ /dev/null @@ -1,100 +0,0 @@ -;! HP-PA-1.1 __mpn_mul_1 -- Multiply a limb vector with a limb and store -;! the result in a second limb vector. - -;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr r26 -;! s1_ptr r25 -;! size r24 -;! s2_limb r23 - -;! This runs at 9 cycles/limb on a PA7000. With the used instructions, it can -;! not become faster due to data cache contention after a store. On the -;! PA7100 it runs at 7 cycles/limb, and that can not be improved either, since -;! only the xmpyu does not need the integer pipeline, so the only dual-issue -;! we will get are addc+xmpyu. Unrolling would not help either CPU. - -;! We could use fldds to read two limbs at a time from the S1 array, and that -;! could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and -;! PA7100, respectively. We don't do that since it does not seem worth the -;! (alignment) troubles... - -;! At least the PA7100 is rumored to be able to deal with cache-misses -;! without stalling instruction issue. If this is true, and the cache is -;! actually also lockup-free, we should use a deeper software pipeline, and -;! load from S1 very early; (The loads and stores to -12(sp) will surely be -;! in the cache.) - - .text - .export __mpn_mul_1 -__mpn_mul_1: - .proc - .callinfo frame=64,no_calls - .entry - - ldo 64(%r30),%r30 - fldws,ma 4(%r25),%fr5 - stw %r23,-16(%r30) ;! move s2_limb ... - addib,= -1,%r24,L$just_one_limb - fldws -16(%r30),%fr4 ;! ... into fr4 - add %r0,%r0,%r0 ;! clear carry - xmpyu %fr4,%fr5,%fr6 - fldws,ma 4(%r25),%fr7 - fstds %fr6,-16(%r30) - xmpyu %fr4,%fr7,%fr8 - ldw -12(%r30),%r20 ;! least significant limb in product - ldw -16(%r30),%r28 - - fstds %fr8,-16(%r30) - addib,= -1,%r24,L$end - ldw -12(%r30),%r1 - -;! Main loop -L$loop: - fldws,ma 4(%r25),%fr5 - stws,ma %r20,4(%r26) - addc %r28,%r1,%r20 - xmpyu %fr4,%fr5,%fr6 - ldw -16(%r30),%r28 - fstds %fr6,-16(%r30) - addib,<> -1,%r24,L$loop - ldw -12(%r30),%r1 - -L$end: - stws,ma %r20,4(%r26) - addc %r28,%r1,%r20 - ldw -16(%r30),%r28 - stws,ma %r20,4(%r26) - addc %r0,%r28,%r28 - bv 0(%r2) - ldo -64(%r30),%r30 - -L$just_one_limb: - xmpyu %fr4,%fr5,%fr6 - fstds %fr6,-16(%r30) - ldw -16(%r30),%r28 - ldo -64(%r30),%r30 - bv 0(%r2) - fstws %fr6R,0(%r26) - - .exit - .procend diff --git a/sysdeps/hppa/hppa1.1/submul_1.s b/sysdeps/hppa/hppa1.1/submul_1.s deleted file mode 100644 index 997bd6d521..0000000000 --- a/sysdeps/hppa/hppa1.1/submul_1.s +++ /dev/null @@ -1,113 +0,0 @@ -;! HP-PA-1.1 __mpn_submul_1 -- Multiply a limb vector with a limb and -;! subtract the result from a second limb vector. - -;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr r26 -;! s1_ptr r25 -;! size r24 -;! s2_limb r23 - -;! This runs at 12 cycles/limb on a PA7000. With the used instructions, it -;! can not become faster due to data cache contention after a store. On the -;! PA7100 it runs at 11 cycles/limb, and that can not be improved either, -;! since only the xmpyu does not need the integer pipeline, so the only -;! dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb -;! on the PA7100. - -;! There are some ideas described in mul_1.s that applies to this code too. - -;! It seems possible to make this run as fast as __mpn_addmul_1, if we use -;! sub,>>= %r29,%r20,%r22 -;! addi 1,%r28,%r28 -;! but that requires reworking the hairy software pipeline... - - .text - .export __mpn_submul_1 -__mpn_submul_1: - .proc - .callinfo frame=64,no_calls - .entry - - ldo 64(%r30),%r30 - fldws,ma 4(%r25),%fr5 - stw %r23,-16(%r30) ;! move s2_limb ... - addib,= -1,%r24,L$just_one_limb - fldws -16(%r30),%fr4 ;! ... into fr4 - add %r0,%r0,%r0 ;! clear carry - xmpyu %fr4,%fr5,%fr6 - fldws,ma 4(%r25),%fr7 - fstds %fr6,-16(%r30) - xmpyu %fr4,%fr7,%fr8 - ldw -12(%r30),%r20 ;! least significant limb in product - ldw -16(%r30),%r28 - - fstds %fr8,-16(%r30) - addib,= -1,%r24,L$end - ldw -12(%r30),%r1 - -;! Main loop -L$loop: - ldws 0(%r26),%r29 - fldws,ma 4(%r25),%fr5 - sub %r29,%r20,%r22 - add %r22,%r20,%r0 - stws,ma %r22,4(%r26) - addc %r28,%r1,%r20 - xmpyu %fr4,%fr5,%fr6 - ldw -16(%r30),%r28 - fstds %fr6,-16(%r30) - addc %r0,%r28,%r28 - addib,<> -1,%r24,L$loop - ldw -12(%r30),%r1 - -L$end: - ldw 0(%r26),%r29 - sub %r29,%r20,%r22 - add %r22,%r20,%r0 - stws,ma %r22,4(%r26) - addc %r28,%r1,%r20 - ldw -16(%r30),%r28 - ldws 0(%r26),%r29 - addc %r0,%r28,%r28 - sub %r29,%r20,%r22 - add %r22,%r20,%r0 - stws,ma %r22,4(%r26) - addc %r0,%r28,%r28 - bv 0(%r2) - ldo -64(%r30),%r30 - -L$just_one_limb: - xmpyu %fr4,%fr5,%fr6 - ldw 0(%r26),%r29 - fstds %fr6,-16(%r30) - ldw -12(%r30),%r1 - ldw -16(%r30),%r28 - sub %r29,%r1,%r22 - add %r22,%r1,%r0 - stw %r22,0(%r26) - addc %r0,%r28,%r28 - bv 0(%r2) - ldo -64(%r30),%r30 - - .exit - .procend diff --git a/sysdeps/hppa/hppa1.1/udiv_qrnnd.s b/sysdeps/hppa/hppa1.1/udiv_qrnnd.s deleted file mode 100644 index 7b83619c7d..0000000000 --- a/sysdeps/hppa/hppa1.1/udiv_qrnnd.s +++ /dev/null @@ -1,78 +0,0 @@ -;! HP-PA __udiv_qrnnd division support, used from longlong.h. -;! This version runs fast on PA 7000 and later. - -;! Copyright (C) 1993, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! rem_ptr gr26 -;! n1 gr25 -;! n0 gr24 -;! d gr23 - - .text -L$0000: - .word 0x43f00000 - .word 0x0 - .export __udiv_qrnnd -__udiv_qrnnd: - .proc - .callinfo frame=64,no_calls - .entry - ldo 64(%r30),%r30 - - stws %r25,-16(%r30) ;! n_hi - stws %r24,-12(%r30) ;! n_lo - b,l L$0,%r1 - ldo L$0000-L$0(%r1),%r1 -L$0: - fldds -16(%r30),%fr5 - stws %r23,-12(%r30) - comib,<= 0,%r25,L$1 - fcnvxf,dbl,dbl %fr5,%fr5 - fldds 0(%r1),%fr4 - fadd,dbl %fr4,%fr5,%fr5 -L$1: - fcpy,sgl %fr0,%fr6L - fldws -12(%r30),%fr6R - fcnvxf,dbl,dbl %fr6,%fr4 - - fdiv,dbl %fr5,%fr4,%fr5 - - fcnvfx,dbl,dbl %fr5,%fr4 - fstws %fr4R,-16(%r30) - xmpyu %fr4R,%fr6R,%fr6 - ldws -16(%r30),%r28 - fstds %fr6,-16(%r30) - ldws -12(%r30),%r21 - ldws -16(%r30),%r20 - sub %r24,%r21,%r22 - subb %r25,%r20,%r1 - comib,= 0,%r1,L$2 - ldo -64(%r30),%r30 - - add %r22,%r23,%r22 - ldo -1(%r28),%r28 -L$2: - bv 0(%r2) - stws %r22,0(%r26) - - .exit - .procend diff --git a/sysdeps/hppa/libgcc-compat.c b/sysdeps/hppa/libgcc-compat.c deleted file mode 100644 index 2957eba89f..0000000000 --- a/sysdeps/hppa/libgcc-compat.c +++ /dev/null @@ -1,43 +0,0 @@ -/* pre-.hidden libgcc compatibility - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Randolph Chung - - 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 <stdint.h> -#include <shlib-compat.h> - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6) - -symbol_version (__clz_tab_internal, __clz_tab, GLIBC_2.2); - -typedef unsigned int UQItype __attribute__ ((mode (QI))); - -const UQItype __clz_tab_internal[] = -{ - 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -}; - -#endif diff --git a/sysdeps/hppa/lshift.s b/sysdeps/hppa/lshift.s deleted file mode 100644 index 151b283e57..0000000000 --- a/sysdeps/hppa/lshift.s +++ /dev/null @@ -1,66 +0,0 @@ -;! HP-PA __mpn_lshift -- - -;! Copyright (C) 1992, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr gr26 -;! s_ptr gr25 -;! size gr24 -;! cnt gr23 - - .text - .export __mpn_lshift -__mpn_lshift: - .proc - .callinfo frame=64,no_calls - .entry - - sh2add %r24,%r25,%r25 - sh2add %r24,%r26,%r26 - ldws,mb -4(%r25),%r22 - subi 32,%r23,%r1 - mtsar %r1 - addib,= -1,%r24,L$0004 - vshd %r0,%r22,%r28 ;! compute carry out limb - ldws,mb -4(%r25),%r29 - addib,= -1,%r24,L$0002 - vshd %r22,%r29,%r20 - -L$loop: ldws,mb -4(%r25),%r22 - stws,mb %r20,-4(%r26) - addib,= -1,%r24,L$0003 - vshd %r29,%r22,%r20 - ldws,mb -4(%r25),%r29 - stws,mb %r20,-4(%r26) - addib,<> -1,%r24,L$loop - vshd %r22,%r29,%r20 - -L$0002: stws,mb %r20,-4(%r26) - vshd %r29,%r0,%r20 - bv 0(%r2) - stw %r20,-4(%r26) -L$0003: stws,mb %r20,-4(%r26) -L$0004: vshd %r22,%r0,%r20 - bv 0(%r2) - stw %r20,-4(%r26) - - .exit - .procend diff --git a/sysdeps/hppa/machine-gmon.h b/sysdeps/hppa/machine-gmon.h deleted file mode 100644 index 3eeef67377..0000000000 --- a/sysdeps/hppa/machine-gmon.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Machine-specific calling sequence for `mcount' profiling function. PA-RISC - Copyright (C) 1995, 1996, 1997, 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. */ - -/* We can call _mcount directly since gcc supplies the correct - * arguments */ -#define _MCOUNT_DECL(from, self) \ - void _mcount (u_long from, u_long self) - -#define MCOUNT diff --git a/sysdeps/hppa/memusage.h b/sysdeps/hppa/memusage.h deleted file mode 100644 index d3dd10e10b..0000000000 --- a/sysdeps/hppa/memusage.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 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. */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%r30"); stack_ptr; }) -#define STACK_GROWS_UPWARD 1 - -#include <sysdeps/generic/memusage.h> diff --git a/sysdeps/hppa/mp_clz_tab.c b/sysdeps/hppa/mp_clz_tab.c deleted file mode 100644 index 52d06383c1..0000000000 --- a/sysdeps/hppa/mp_clz_tab.c +++ /dev/null @@ -1 +0,0 @@ -/* __clz_tab not needed on hppa. */ diff --git a/sysdeps/hppa/rshift.s b/sysdeps/hppa/rshift.s deleted file mode 100644 index dff189dc48..0000000000 --- a/sysdeps/hppa/rshift.s +++ /dev/null @@ -1,63 +0,0 @@ -;! HP-PA __mpn_rshift -- - -;! Copyright (C) 1992, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr gr26 -;! s_ptr gr25 -;! size gr24 -;! cnt gr23 - - .text - .export __mpn_rshift -__mpn_rshift: - .proc - .callinfo frame=64,no_calls - .entry - - ldws,ma 4(%r25),%r22 - mtsar %r23 - addib,= -1,%r24,L$0004 - vshd %r22,%r0,%r28 ;! compute carry out limb - ldws,ma 4(%r25),%r29 - addib,= -1,%r24,L$0002 - vshd %r29,%r22,%r20 - -L$loop: ldws,ma 4(%r25),%r22 - stws,ma %r20,4(%r26) - addib,= -1,%r24,L$0003 - vshd %r22,%r29,%r20 - ldws,ma 4(%r25),%r29 - stws,ma %r20,4(%r26) - addib,<> -1,%r24,L$loop - vshd %r29,%r22,%r20 - -L$0002: stws,ma %r20,4(%r26) - vshd %r0,%r29,%r20 - bv 0(%r2) - stw %r20,0(%r26) -L$0003: stws,ma %r20,4(%r26) -L$0004: vshd %r0,%r22,%r20 - bv 0(%r2) - stw %r20,0(%r26) - - .exit - .procend diff --git a/sysdeps/hppa/setjmp.S b/sysdeps/hppa/setjmp.S deleted file mode 100644 index 0da34db6f1..0000000000 --- a/sysdeps/hppa/setjmp.S +++ /dev/null @@ -1,69 +0,0 @@ -/* setjmp for HPPA. - Copyright (C) 1995, 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. */ - -#include <sysdep.h> -#define _ASM -#define _SETJMP_H -#include <bits/setjmp.h> - - - .text - .align 4 - .import __sigjmp_save, code - .globl __sigsetjmp - .export __sigsetjmp, code - .proc - .callinfo -__sigsetjmp: - stw %r3, 0(%r26) - stw %r4, 8(%r26) - stw %r5, 12(%r26) - stw %r6, 16(%r26) - stw %r7, 20(%r26) - stw %r8, 24(%r26) - stw %r9, 28(%r26) - stw %r10, 32(%r26) - stw %r11, 36(%r26) - stw %r12, 40(%r26) - stw %r13, 44(%r26) - stw %r14, 48(%r26) - stw %r15, 52(%r26) - stw %r16, 56(%r26) - stw %r17, 60(%r26) - stw %r18, 64(%r26) - stw %r19, 68(%r26) - stw %r27, 72(%r26) - stw %r30, 76(%r26) - - stw %rp, 80(%r26) - - ldo 88(%r26),%r1 - fstds,ma %fr12, 8(%r1) /* 88 */ - fstds,ma %fr13, 8(%r1) /* 96 */ - fstds,ma %fr14, 8(%r1) /* 104 */ - fstds,ma %fr15, 8(%r1) /* 112 */ - fstds,ma %fr16, 8(%r1) /* 120 */ - fstds,ma %fr17, 8(%r1) /* 128 */ - fstds,ma %fr18, 8(%r1) /* 136 */ - fstds,ma %fr19, 8(%r1) /* 144 */ - fstds,ma %fr20, 8(%r1) /* 152 */ - fstds %fr21, 0(%r1) /* 160 */ - b __sigjmp_save - nop - .procend diff --git a/sysdeps/hppa/stackinfo.h b/sysdeps/hppa/stackinfo.h deleted file mode 100644 index 318de7143b..0000000000 --- a/sysdeps/hppa/stackinfo.h +++ /dev/null @@ -1,28 +0,0 @@ -/* 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 PA the stack grows up. */ -#define _STACK_GROWS_UP 1 - -#endif /* stackinfo.h */ diff --git a/sysdeps/hppa/sub_n.s b/sysdeps/hppa/sub_n.s deleted file mode 100644 index 7764961a2d..0000000000 --- a/sysdeps/hppa/sub_n.s +++ /dev/null @@ -1,59 +0,0 @@ -;! HP-PA __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and -;! store difference in a third limb vector. - -;! Copyright (C) 1992, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr gr26 -;! s1_ptr gr25 -;! s2_ptr gr24 -;! size gr23 - -;! One might want to unroll this as for other processors, but it turns -;! out that the data cache contention after a store makes such -;! unrolling useless. We can't come under 5 cycles/limb anyway. - - .text - .export __mpn_sub_n -__mpn_sub_n: - .proc - .callinfo frame=0,no_calls - .entry - - ldws,ma 4(%r25),%r21 - ldws,ma 4(%r24),%r20 - - addib,= -1,%r23,L$end ;! check for (SIZE == 1) - sub %r21,%r20,%r28 ;! subtract first limbs ignoring cy - -L$loop: ldws,ma 4(%r25),%r21 - ldws,ma 4(%r24),%r20 - stws,ma %r28,4(%r26) - addib,<> -1,%r23,L$loop - subb %r21,%r20,%r28 - -L$end: stws %r28,0(%r26) - addc %r0,%r0,%r28 - bv 0(%r2) - subi 1,%r28,%r28 - - .exit - .procend diff --git a/sysdeps/hppa/sysdep.h b/sysdeps/hppa/sysdep.h deleted file mode 100644 index be36567434..0000000000 --- a/sysdeps/hppa/sysdep.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Assembler macros for HP/PA. - Copyright (C) 1999, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. - - 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 <sysdeps/generic/sysdep.h> -#include <sys/syscall.h> -#include "config.h" - -#ifndef ASM_LINE_SEP -#define ASM_LINE_SEP ; -#endif - -#ifdef __ASSEMBLER__ - -/* Syntactic details of assembler. */ - -#define ALIGNARG(log2) log2 - - -/* Define an entry point visible from C. - - There is currently a bug in gdb which prevents us from specifying - incomplete stabs information. Fake some entries here which specify - the current source file. */ -#define ENTRY(name) \ - .SPACE $TEXT$ ASM_LINE_SEP \ - .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY ASM_LINE_SEP \ - .align ALIGNARG(4) ASM_LINE_SEP \ - .NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY ASM_LINE_SEP \ - .EXPORT C_SYMBOL_NAME(name),ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR ASM_LINE_SEP\ - C_LABEL(name) \ - CALL_MCOUNT - -#undef END -#define END(name) \ - .PROCEND - - -/* If compiled for profiling, call `mcount' at the start of each function. */ -#ifdef PROF -/* The mcount code relies on a normal frame pointer being on the stack - to locate our caller, so push one just for its benefit. */ -#define CALL_MCOUNT \ - XXX ASM_LINE_SEP -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - -#define PSEUDO(name, syscall_name, args) \ - ENTRY (name) \ - DO_CALL (syscall_name, args) - -#undef PSEUDO_END -#define PSEUDO_END(name) \ - END (name) - -#undef JUMPTARGET -#define JUMPTARGET(name) name -#define SYSCALL_PIC_SETUP /* Nothing. */ - -/* Local label name for asm code. */ -#ifndef L -#define L(name) name -#endif - -#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/hppa/udiv_qrnnd.s b/sysdeps/hppa/udiv_qrnnd.s deleted file mode 100644 index 8e9c07a205..0000000000 --- a/sysdeps/hppa/udiv_qrnnd.s +++ /dev/null @@ -1,286 +0,0 @@ -;! HP-PA __udiv_qrnnd division support, used from longlong.h. -;! This version runs fast on pre-PA7000 CPUs. - -;! Copyright (C) 1993, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! rem_ptr gr26 -;! n1 gr25 -;! n0 gr24 -;! d gr23 - -;! The code size is a bit excessive. We could merge the last two ds;addc -;! sequences by simply moving the "bb,< Odd" instruction down. The only -;! trouble is the FFFFFFFF code that would need some hacking. - - .text - .export __udiv_qrnnd -__udiv_qrnnd: - .proc - .callinfo frame=0,no_calls - .entry - - comb,< %r23,%r0,L$largedivisor - sub %r0,%r23,%r1 ;! clear cy as side-effect - ds %r0,%r1,%r0 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r24 - ds %r25,%r23,%r25 - addc %r24,%r24,%r28 - ds %r25,%r23,%r25 - comclr,>= %r25,%r0,%r0 - addl %r25,%r23,%r25 - stws %r25,0(%r26) - bv 0(%r2) - addc %r28,%r28,%r28 - -L$largedivisor: - extru %r24,31,1,%r20 ;! r20 = n0 & 1 - bb,< %r23,31,L$odd - extru %r23,30,31,%r22 ;! r22 = d >> 1 - shd %r25,%r24,1,%r24 ;! r24 = new n0 - extru %r25,30,31,%r25 ;! r25 = new n1 - sub %r0,%r22,%r21 - ds %r0,%r21,%r0 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - comclr,>= %r25,%r0,%r0 - addl %r25,%r22,%r25 - sh1addl %r25,%r20,%r25 - stws %r25,0(%r26) - bv 0(%r2) - addc %r24,%r24,%r28 - -L$odd: addib,sv,n 1,%r22,L$FF.. ;! r22 = (d / 2 + 1) - shd %r25,%r24,1,%r24 ;! r24 = new n0 - extru %r25,30,31,%r25 ;! r25 = new n1 - sub %r0,%r22,%r21 - ds %r0,%r21,%r0 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r24 - ds %r25,%r22,%r25 - addc %r24,%r24,%r28 - comclr,>= %r25,%r0,%r0 - addl %r25,%r22,%r25 - sh1addl %r25,%r20,%r25 -;! We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25 - add,nuv %r28,%r25,%r25 - addl %r25,%r1,%r25 - addc %r0,%r28,%r28 - sub,<< %r25,%r23,%r0 - addl %r25,%r1,%r25 - stws %r25,0(%r26) - bv 0(%r2) - addc %r0,%r28,%r28 - -;! This is just a special case of the code above. -;! We come here when d == 0xFFFFFFFF -L$FF..: add,uv %r25,%r24,%r24 - sub,<< %r24,%r23,%r0 - ldo 1(%r24),%r24 - stws %r24,0(%r26) - bv 0(%r2) - addc %r0,%r25,%r28 - - .exit - .procend diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S index 5ea50efff8..dfa1aa7019 100644 --- a/sysdeps/i386/i686/memset.S +++ b/sysdeps/i386/i686/memset.S @@ -1,6 +1,6 @@ /* memset/bzero -- set memory area to CH/0 Highly optimized version for ix86, x>=6. - Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1999,2000,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999. @@ -64,17 +64,17 @@ ENTRY (BP_SYM (memset)) movl %edx, %edi cfi_rel_offset (edi, 0) andl $3, %edx - jz 2f - jnp 3f - stosb + jz 2f /* aligned */ + jp 3f /* misaligned at 3, store just one byte below */ + stosb /* misaligned at 1 or 2, store two bytes */ decl %ecx jz 1f 3: stosb decl %ecx jz 1f - xorl $3, %edx - jz 2f - stosb + xorl $1, %edx + jnz 2f /* was misaligned at 2 or 3, now aligned */ + stosb /* was misaligned at 1, store third byte */ decl %ecx 2: movl %ecx, %edx shrl $2, %ecx diff --git a/sysdeps/m68k/Implies b/sysdeps/m68k/Implies deleted file mode 100644 index 5c778d4fbc..0000000000 --- a/sysdeps/m68k/Implies +++ /dev/null @@ -1,5 +0,0 @@ -wordsize-32 -# 68k uses IEEE 754 floating point. -ieee754/ldbl-96 -ieee754/dbl-64 -ieee754/flt-32 diff --git a/sysdeps/m68k/Makefile b/sysdeps/m68k/Makefile deleted file mode 100644 index fab6bd5837..0000000000 --- a/sysdeps/m68k/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 1993, 1994, 1996, 1997, 2003 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. - -# The mpn functions need this. All existing 68k ports use MIT syntax. If -# a new port wants to use Motorola or Sony syntax, it can redefine this -# variable. -ifndef m68k-syntax-flag -m68k-syntax-flag = -DMIT_SYNTAX -endif - -asm-CPPFLAGS += $(m68k-syntax-flag) - -pic-ccflag = -fpic - -# Make sure setjmp.c is compiled with a frame pointer -CFLAGS-setjmp.c := -fno-omit-frame-pointer - -# The 68k `long double' is a distinct type we support. -long-double-fcts = yes - -ifeq ($(subdir),elf) -CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused -endif diff --git a/sysdeps/m68k/Versions b/sysdeps/m68k/Versions deleted file mode 100644 index f450291a9b..0000000000 --- a/sysdeps/m68k/Versions +++ /dev/null @@ -1,13 +0,0 @@ -libc { - GLIBC_2.0 { - # Functions from libgcc. - __divdi3; __moddi3; __udivdi3; __umoddi3; - } -} -libm { - GLIBC_2.1 { - # A generic bug got this omitted from other configurations' version - # sets, but we always had it. - exp2l; - } -} diff --git a/sysdeps/m68k/__longjmp.c b/sysdeps/m68k/__longjmp.c deleted file mode 100644 index 89ff5bab56..0000000000 --- a/sysdeps/m68k/__longjmp.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 97 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 <setjmp.h> -#include <stdlib.h> - -/* Jump to the position specified by ENV, causing the - setjmp call there to return VAL, or 1 if VAL is 0. */ -void -__longjmp (__jmp_buf env, int val) -{ - /* This restores the FP and SP that setjmp's caller had, - and puts the return address into A0 and VAL into D0. */ - -#if defined(__HAVE_68881__) || defined(__HAVE_FPU__) - /* Restore the floating-point registers. */ - asm volatile("fmovem%.x %0, %/fp0-%/fp7" : - /* No outputs. */ : "g" (env[0].__fpregs[0])); -#endif - - /* Put VAL in D0. */ - asm volatile("move%.l %0, %/d0" : /* No outputs. */ : - "g" (val == 0 ? 1 : val) : "d0"); - - asm volatile(/* Restore the data and address registers. */ - "movem%.l %0, %/d1-%/d7/%/a0-%/a7\n" - /* Return to setjmp's caller. */ -#ifdef __motorola__ - "jmp (%/a0)" -#else - "jmp %/a0@" -#endif - : /* No outputs. */ : "g" (env[0].__dregs[0]) - /* We don't bother with the clobbers, - because this code always jumps out anyway. */ - ); - - /* Avoid `volatile function does return' warnings. */ - for (;;); -} diff --git a/sysdeps/m68k/abort-instr.h b/sysdeps/m68k/abort-instr.h deleted file mode 100644 index b43c9efe1d..0000000000 --- a/sysdeps/m68k/abort-instr.h +++ /dev/null @@ -1,2 +0,0 @@ -/* An instruction which should crash any program is `illegal'. */ -#define ABORT_INSTRUCTION asm ("illegal") diff --git a/sysdeps/m68k/add_n.S b/sysdeps/m68k/add_n.S deleted file mode 100644 index a9558491e8..0000000000 --- a/sysdeps/m68k/add_n.S +++ /dev/null @@ -1,76 +0,0 @@ -/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store - sum in a third limb vector. - -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s1_ptr (sp + 8) - s2_ptr (sp + 16) - size (sp + 12) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - - TEXT -ENTRY(__mpn_add_n) -/* Save used registers on the stack. */ - movel R(d2),MEM_PREDEC(sp) - movel R(a2),MEM_PREDEC(sp) - -/* Copy the arguments to registers. Better use movem? */ - movel MEM_DISP(sp,12),R(a2) - movel MEM_DISP(sp,16),R(a0) - movel MEM_DISP(sp,20),R(a1) - movel MEM_DISP(sp,24),R(d2) - - eorw #1,R(d2) - lsrl #1,R(d2) - bcc L(L1) - subql #1,R(d2) /* clears cy as side effect */ - -L(Loop:) - movel MEM_POSTINC(a0),R(d0) - movel MEM_POSTINC(a1),R(d1) - addxl R(d1),R(d0) - movel R(d0),MEM_POSTINC(a2) -L(L1:) movel MEM_POSTINC(a0),R(d0) - movel MEM_POSTINC(a1),R(d1) - addxl R(d1),R(d0) - movel R(d0),MEM_POSTINC(a2) - - dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */ - subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */ - subl #0x10000,R(d2) - bcs L(L2) - addl R(d0),R(d0) /* restore cy */ - bra L(Loop) - -L(L2:) - negl R(d0) - -/* Restore used registers from stack frame. */ - movel MEM_POSTINC(sp),R(a2) - movel MEM_POSTINC(sp),R(d2) - - rts -END(__mpn_add_n) diff --git a/sysdeps/m68k/asm-syntax.h b/sysdeps/m68k/asm-syntax.h deleted file mode 100644 index 8e2a4ca2ca..0000000000 --- a/sysdeps/m68k/asm-syntax.h +++ /dev/null @@ -1,109 +0,0 @@ -/* 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<<log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -#define PROLOG(name) .type name,@function -#define EPILOG(name) .size name,.-name -/* For ELF we need to prefix register names and local labels. */ -#ifdef __STDC__ -#define R_(r) %##r -#define R(r) R_(r) -#define L(label) .##label -#else -#define R(r) %/**/r -#define L(label) ./**/label -#endif - -#else - -#define ALIGNARG(log2) log2 -#define PROLOG(name) /* Nothing. */ -#define EPILOG(name) /* Nothing. */ -#define R(r) r -#define L(label) label - -#endif - -#ifdef MIT_SYNTAX -#define MEM(base)R(base)@ -#define MEM_DISP(base,displacement)R(base)@(displacement) -#define MEM_INDX(base,idx,size_suffix)R(base)@(R(idx):size_suffix) -#define MEM_INDX1(base,idx,size_suffix,scale)R(base)@(R(idx):size_suffix:scale) -#define MEM_PREDEC(memory_base)R(memory_base)@- -#define MEM_POSTINC(memory_base)R(memory_base)@+ -#define TEXT .text -#define ALIGN .even -#define GLOBL .globl -/* Use variable sized opcodes. */ -#define bcc jcc -#define bcs jcs -#define bls jls -#define beq jeq -#define bne jne -#define bra jra -#endif - -#ifdef MOTOROLA_SYNTAX -#define MEM(base)(R(base)) -#define MEM_DISP(base,displacement)(displacement,R(base)) -#define MEM_PREDEC(memory_base)-(R(memory_base)) -#define MEM_POSTINC(memory_base)(R(memory_base))+ -#ifdef __STDC__ -#define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix)) -#define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix) -#define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale)) -#define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale) -#else -#define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix) -#define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale) -#endif -#define TEXT .text -#define ALIGN .align ALIGNARG(2) -#define GLOBL .globl -#define bcc jbcc -#define bcs jbcs -#define bls jbls -#define beq jbeq -#define bne jbne -#define bra jbra -#define movel move.l -#define moveml movem.l -#define moveql moveq.l -#define cmpl cmp.l -#define orl or.l -#define clrl clr.l -#define eorw eor.w -#define lsrl lsr.l -#define lsll lsl.l -#define roxrl roxr.l -#define roxll roxl.l -#define addl add.l -#define addxl addx.l -#define addql addq.l -#define subl sub.l -#define subxl subx.l -#define subql subq.l -#define negl neg.l -#define mulul mulu.l -#endif diff --git a/sysdeps/m68k/bits/byteswap.h b/sysdeps/m68k/bits/byteswap.h deleted file mode 100644 index 549d4452ef..0000000000 --- a/sysdeps/m68k/bits/byteswap.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Macros to swap the order of bytes in integer values. m68k version. - Copyright (C) 1997, 2002 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 _BYTESWAP_H && !defined _NETINET_IN_H -# error "Never use <bits/byteswap.h> directly; include <byteswap.h> 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/sysdeps/m68k/bits/endian.h b/sysdeps/m68k/bits/endian.h deleted file mode 100644 index bf4ecb60a4..0000000000 --- a/sysdeps/m68k/bits/endian.h +++ /dev/null @@ -1,7 +0,0 @@ -/* m68k is big-endian. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/m68k/bits/huge_vall.h b/sysdeps/m68k/bits/huge_vall.h deleted file mode 100644 index 8b9630c6df..0000000000 --- a/sysdeps/m68k/bits/huge_vall.h +++ /dev/null @@ -1,43 +0,0 @@ -/* `HUGE_VALL' constant for m68k (where it is infinity). - Used by <stdlib.h> and <math.h> functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 - 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 <bits/huge_val.h> directly; include <math.h> instead." -#endif - -#if __GNUC_PREREQ(3,3) -# define HUGE_VALL (__builtin_huge_vall ()) -#elif __GNUC_PREREQ(2,96) -# define HUGE_VALL (__extension__ 0x1.0p32767L) -#elif defined__GNUC__ - -# 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[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 2.95. */ diff --git a/sysdeps/m68k/bits/link.h b/sysdeps/m68k/bits/link.h deleted file mode 100644 index 9d0a94592f..0000000000 --- a/sysdeps/m68k/bits/link.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2005 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 _LINK_H -# error "Never include <bits/link.h> directly; use <link.h> instead." -#endif - - -/* Registers for entry into PLT on M68K. */ -typedef struct La_m68k_regs -{ - uint32_t lr_a0; - uint32_t lr_a1; - uint32_t lr_sp; -} La_m68k_regs; - -/* Return values for calls from PLT on M68K. */ -typedef struct La_m68k_retval -{ - uint32_t lrv_d0; - uint32_t lrv_d1; - uint32_t lrv_a0; - long double lrv_fp0; -} La_m68k_retval; - - -__BEGIN_DECLS - -extern Elf32_Addr la_m68k_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_m68k_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_m68k_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_m68k_regs *__inregs, - La_m68k_retval *__outregs, - const char *symname); - -__END_DECLS diff --git a/sysdeps/m68k/bits/mathdef.h b/sysdeps/m68k/bits/mathdef.h deleted file mode 100644 index 65cf8d49f6..0000000000 --- a/sysdeps/m68k/bits/mathdef.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2004 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 <bits/mathdef.h> directly; include <math.h> 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'. */ - -/* 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/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h deleted file mode 100644 index 2d5a08227d..0000000000 --- a/sysdeps/m68k/bits/setjmp.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 1997,1998,2005,2006 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 the machine-dependent type `jmp_buf'. m68k version. */ -#ifndef _BITS_SETJMP_H -#define _BITS_SETJMP_H 1 - -#if !defined _SETJMP_H && !defined _PTHREAD_H -# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." -#endif - -typedef struct - { - /* There are eight 4-byte data registers, but D0 is not saved. */ - long int __dregs[7]; - - /* There are six 4-byte address registers, plus the FP and SP. */ - int *__aregs[6]; - int *__fp; - int *__sp; - -#if defined __HAVE_68881__ || defined __HAVE_FPU__ - /* There are eight floating point registers which - are saved in IEEE 96-bit extended format. */ - char __fpregs[8 * (96 / 8)]; -#endif - - } __jmp_buf[1]; - -#endif /* bits/setjmp.h */ diff --git a/sysdeps/m68k/bsd-_setjmp.c b/sysdeps/m68k/bsd-_setjmp.c deleted file mode 100644 index a6b404aebe..0000000000 --- a/sysdeps/m68k/bsd-_setjmp.c +++ /dev/null @@ -1,22 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version. - Copyright (C) 1994, 1997, 2001, 2002 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 BSD__SETJMP -#include <sysdeps/m68k/setjmp.c> -libc_hidden_def (_setjmp) diff --git a/sysdeps/m68k/bsd-setjmp.c b/sysdeps/m68k/bsd-setjmp.c deleted file mode 100644 index 59b5acfeeb..0000000000 --- a/sysdeps/m68k/bsd-setjmp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. m68k version. - Copyright (C) 1994, 1997, 2001 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 BSD_SETJMP -#include <sysdeps/m68k/setjmp.c> diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h deleted file mode 100644 index f31b68772d..0000000000 --- a/sysdeps/m68k/dl-machine.h +++ /dev/null @@ -1,290 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. m68k version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 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 dl_machine_h -#define dl_machine_h - -#define ELF_MACHINE_NAME "m68k" - -#include <sys/param.h> - -/* Return nonzero iff ELF header is compatible with the running host. */ -static inline int -elf_machine_matches_host (const Elf32_Ehdr *ehdr) -{ - return ehdr->e_machine == EM_68K; -} - - -/* Return the link-time address of _DYNAMIC. Conveniently, this is the - first element of the GOT. This must be inlined in a function which - uses global data. */ -static inline Elf32_Addr -elf_machine_dynamic (void) -{ - register Elf32_Addr *got asm ("%a5"); - return *got; -} - - -/* Return the run-time load address of the shared object. */ -static inline Elf32_Addr -elf_machine_load_address (void) -{ - Elf32_Addr addr; - asm ("lea _dl_start(%%pc), %0\n\t" - "sub.l _dl_start@GOT.w(%%a5), %0" - : "=a" (addr)); - return addr; -} - - -/* Set up the loaded object described by L so its unrelocated PLT - entries will jump to the on-demand fixup code in dl-runtime.c. */ - -static inline int __attribute__ ((always_inline)) -elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) -{ - Elf32_Addr *got; - extern void _dl_runtime_resolve (Elf32_Word); - extern void _dl_runtime_profile (Elf32_Word); - - if (l->l_info[DT_JMPREL] && lazy) - { - /* The GOT entries for functions in the PLT have not yet been - filled in. Their initial contents will arrange when called - to push an offset into the .rela.plt section, push - _GLOBAL_OFFSET_TABLE_[1], and then jump to - _GLOBAL_OFFSET_TABLE_[2]. */ - got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]); - got[1] = (Elf32_Addr) l; /* Identify this shared object. */ - - /* The got[2] entry contains the address of a function which gets - called to get the address of a so far unresolved function and - jump to it. The profiling extension of the dynamic linker allows - to intercept the calls to collect information. In this case we - don't store the address in the GOT so that all future calls also - end in this function. */ - if (profile) - { - got[2] = (Elf32_Addr) &_dl_runtime_profile; - - if (GLRO(dl_profile) != NULL - && _dl_name_match_p (GLRO(dl_profile), l)) - { - /* This is the object we are looking for. Say that we really - want profiling and the timers are started. */ - GL(dl_profile_map) = l; - } - } - else - /* This function will get called to fix up the GOT entry indicated by - the offset on the stack, and then jump to the resolved address. */ - got[2] = (Elf32_Addr) &_dl_runtime_resolve; - } - - return lazy; -} - -#define ELF_MACHINE_RUNTIME_FIXUP_ARGS long int save_a0, long int save_a1 - - -/* Mask identifying addresses reserved for the user program, - where the dynamic linker should not map anything. */ -#define ELF_MACHINE_USER_ADDRESS_MASK 0x80000000UL - -/* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. */ - -#define RTLD_START asm ("\ - .text\n\ - .globl _start\n\ - .type _start,@function\n\ -_start:\n\ - move.l %sp, -(%sp)\n\ - jbsr _dl_start\n\ - addq.l #4, %sp\n\ - /* FALLTHRU */\n\ -\n\ - .globl _dl_start_user\n\ - .type _dl_start_user,@function\n\ -_dl_start_user:\n\ - | Save the user entry point address in %a4.\n\ - move.l %d0, %a4\n\ - | See if we were run as a command with the executable file\n\ - | name as an extra leading argument.\n\ - move.l _dl_skip_args(%pc), %d0\n\ - | Pop the original argument count\n\ - move.l (%sp)+, %d1\n\ - | Subtract _dl_skip_args from it.\n\ - sub.l %d0, %d1\n\ - | Adjust the stack pointer to skip _dl_skip_args words.\n\ - lea (%sp, %d0*4), %sp\n\ - | Push back the modified argument count.\n\ - move.l %d1, -(%sp)\n\ - # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\ - pea 8(%sp, %d1*4)\n\ - pea 8(%sp)\n\ - move.l %d1, -(%sp)\n\ - move.l _rtld_local(%pc), -(%sp)\n\ - jbsr _dl_init_internal@PLTPC\n\ - addq.l #8, %sp\n\ - addq.l #8, %sp\n\ - | Pass our finalizer function to the user in %a1.\n\ - lea _dl_fini(%pc), %a1\n\ - | Initialize %fp with the stack pointer.\n\ - move.l %sp, %fp\n\ - | Jump to the user's entry point.\n\ - jmp (%a4)\n\ - .size _dl_start_user, . - _dl_start_user\n\ - .previous"); - -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. - ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one - of the main executable's symbols, as for a COPY reloc. */ -#define elf_machine_type_class(type) \ - ((((type) == R_68K_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_68K_COPY) * ELF_RTYPE_CLASS_COPY)) - -/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ -#define ELF_MACHINE_JMP_SLOT R_68K_JMP_SLOT - -/* The m68k never uses Elf32_Rel relocations. */ -#define ELF_MACHINE_NO_REL 1 - -static inline Elf32_Addr -elf_machine_fixup_plt (struct link_map *map, lookup_t t, - const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr value) -{ - return *reloc_addr = value; -} - -/* Return the final value of a plt relocation. On the m68k the JMP_SLOT - relocation ignores the addend. */ -static inline Elf32_Addr -elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, - Elf32_Addr value) -{ - return value; -} - -/* Names of the architecture-specific auditing callback functions. */ -#define ARCH_LA_PLTENTER m68k_gnu_pltenter -#define ARCH_LA_PLTEXIT m68k_gnu_pltexit - -#endif /* !dl_machine_h */ - -#ifdef RESOLVE_MAP - -/* Perform the relocation specified by RELOC and SYM (which is fully resolved). - MAP is the object containing the reloc. */ - -auto inline void __attribute__ ((unused, always_inline)) -elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, - const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) -{ - Elf32_Addr *const reloc_addr = reloc_addr_arg; - const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); - - if (__builtin_expect (r_type == R_68K_RELATIVE, 0)) - *reloc_addr = map->l_addr + reloc->r_addend; - else - { - const Elf32_Sym *const refsym = sym; - struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); - Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; - - switch (r_type) - { - case R_68K_COPY: - if (sym == NULL) - /* This can happen in trace mode if an object could not be - found. */ - break; - if (sym->st_size > refsym->st_size - || (sym->st_size < refsym->st_size && GLRO(dl_verbose))) - { - const char *strtab; - - strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); - _dl_error_printf ("\ -%s: Symbol `%s' has different size in shared object, consider re-linking\n", - rtld_progname ?: "<program name unknown>", - strtab + refsym->st_name); - } - memcpy (reloc_addr_arg, (void *) value, - MIN (sym->st_size, refsym->st_size)); - break; - case R_68K_GLOB_DAT: - case R_68K_JMP_SLOT: - *reloc_addr = value; - break; - case R_68K_8: - *(char *) reloc_addr = value + reloc->r_addend; - break; - case R_68K_16: - *(short *) reloc_addr = value + reloc->r_addend; - break; - case R_68K_32: - *reloc_addr = value + reloc->r_addend; - break; - case R_68K_PC8: - *(char *) reloc_addr - = value + reloc->r_addend - (Elf32_Addr) reloc_addr; - break; - case R_68K_PC16: - *(short *) reloc_addr - = value + reloc->r_addend - (Elf32_Addr) reloc_addr; - break; - case R_68K_PC32: - *reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr; - break; - case R_68K_NONE: /* Alright, Wilbur. */ - break; - default: - _dl_reloc_bad_type (map, r_type, 0); - break; - } - } -} - -auto inline void __attribute__ ((unused, always_inline)) -elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, - void *const reloc_addr_arg) -{ - Elf32_Addr *const reloc_addr = reloc_addr_arg; - *reloc_addr = l_addr + reloc->r_addend; -} - -auto inline void __attribute__ ((unused, always_inline)) -elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) -{ - Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); - if (ELF32_R_TYPE (reloc->r_info) == R_68K_JMP_SLOT) - *reloc_addr += l_addr; - else - _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 1); -} - -#endif /* RESOLVE_MAP */ diff --git a/sysdeps/m68k/dl-trampoline.S b/sysdeps/m68k/dl-trampoline.S deleted file mode 100644 index 8791280371..0000000000 --- a/sysdeps/m68k/dl-trampoline.S +++ /dev/null @@ -1,129 +0,0 @@ -/* PLT trampolines. m68k version. - Copyright (C) 2005 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 <sysdep.h> - - .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, @function -_dl_runtime_resolve: - | Save %a0 (struct return address) and %a1. - move.l %a0, -(%sp) - move.l %a1, -(%sp) - | Call the real address resolver. - jbsr _dl_fixup - | Restore register %a0 and %a1. - move.l (%sp)+, %a1 - move.l (%sp)+, %a0 - | Pop parameters - addq.l #8, %sp - | Call real function. - jmp (%d0) - .size _dl_runtime_resolve, . - _dl_runtime_resolve - - .text - .globl _dl_runtime_profile - .type _dl_runtime_profile, @function -_dl_runtime_profile: - pea 8(%sp) - move.l %a1, -(%sp) - move.l %a0, -(%sp) - pea -1.w - | Push parameters for _dl_profile_fixup - pea (%sp) - pea 8(%sp) - move.l 32(%sp), -(%sp) - move.l 32(%sp), -(%sp) - move.l 32(%sp), -(%sp) - subq.l #8, %sp - | Call the real address resolver. - jbsr _dl_profile_fixup - | Pop parameters - lea 28(%sp), %sp - move.l (%sp), %d1 - jpl 1f - addq.l #4, %sp - | Restore register %a0 and %a1. - move.l (%sp)+, %a0 - move.l (%sp)+, %a1 - lea 12(%sp), %sp - | Call real function. - jmp (%d0) - - /* - +24 return address - +20 PLT1 - +16 PLT2 - +12 %sp - +8 %a1 - +4 %a0 - %sp free - */ -1: move.l %a2, (%sp) - move.l %sp, %a2 - move.l %sp, %a0 - lea 28(%sp), %a1 - | Round framesize up to even - addq.l #1, %d1 - lsr #1, %d1 - sub.l %d1, %a0 - sub.l %d1, %a0 - move.l %a0, %sp - jra 2f -1: move.w (%a1)+, (%a0)+ -2: dbra %d1,1b - /* - %a2+24 return address - %a2+20 PLT1 - %a2+16 PLT2 - %a2+12 %sp - %a2+8 %a1 - %a2+4 %a0 - %a2 %a2 - %sp copied stack frame - */ - - move.l 4(%a2), %a0 - move.l 8(%a2), %a1 - jsr (%d0) - move.l %a2, %sp - move.l (%sp)+, %a2 - /* - +20 return address - +16 PLT1 - +12 PLT2 - +8 %sp - +4 %a1 - %sp %a0 - */ - fmove.x %fp0, -(%sp) - move.l %d1, -(%sp) - move.l %d0, -(%sp) - pea (%sp) - pea 20(%sp) - move.l 40(%sp), -(%sp) - move.l 40(%sp), -(%sp) - jbsr _dl_call_pltexit - lea 16(%sp), %sp - move.l (%sp)+, %d0 - move.l (%sp)+, %d1 - fmove.x (%sp)+, %fp0 - lea 20(%sp), %sp - rts - .size _dl_runtime_profile, . - _dl_runtime_profile diff --git a/sysdeps/m68k/elf/start.S b/sysdeps/m68k/elf/start.S deleted file mode 100644 index 8c89b37eca..0000000000 --- a/sysdeps/m68k/elf/start.S +++ /dev/null @@ -1,100 +0,0 @@ -/* Startup code compliant to the ELF m68k ABI. - Copyright (C) 1996, 1997, 1998, 2001, 2002 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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 is the canonical entry point, usually the first thing in the text - segment. The SVR4/m68k ABI says that when the entry point runs, - most registers' values are unspecified, except for: - - %a1 Contains a function pointer to be registered with `atexit'. - This is how the dynamic linker arranges to have DT_FINI - functions called for shared libraries that have been loaded - before this code runs. - - %sp The stack contains the arguments and environment: - 0(%sp) argc - 4(%sp) argv[0] - ... - (4*argc)(%sp) NULL - (4*(argc+1))(%sp) envp[0] - ... - NULL -*/ - - .text - .globl _start - .type _start,@function -_start: - /* Clear the frame pointer. The ABI suggests this be done, to mark - the outermost frame obviously. */ - sub.l %fp, %fp - - /* Extract the arguments as encoded on the stack and set up the - arguments for `main': argc, argv. envp will be determined - later in __libc_start_main. */ - move.l (%sp)+, %d0 /* Pop the argument count. */ - move.l %sp, %a0 /* The argument vector starts just at the - current stack top. */ - - /* Provide the highest stack address to the user code (for stacks - which grow downward). */ - pea (%sp) - - pea (%a1) /* Push address of the shared library - termination function. */ - - /* Push the address of our own entry points to `.fini' and - `.init'. */ - pea __libc_csu_fini - pea __libc_csu_init - - pea (%a0) /* Push second argument: argv. */ - move.l %d0, -(%sp) /* Push first argument: argc. */ - - pea main - - /* Call the user's main function, and exit with its value. But - let the libc call main. */ - jbsr __libc_start_main - - illegal /* Crash if somehow `exit' does return. */ - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/sysdeps/m68k/ffs.c b/sysdeps/m68k/ffs.c deleted file mode 100644 index 2032e8662c..0000000000 --- a/sysdeps/m68k/ffs.c +++ /dev/null @@ -1,48 +0,0 @@ -/* ffs -- find first set bit in a word, counted from least significant end. - For mc68020, mc68030, mc68040. - This file is part of the GNU C Library. - Copyright (C) 1991, 1992, 1997, 1998, 2004, 2005 Free Software Foundation, Inc. - Contributed by Torbjorn Granlund (tege@sics.se). - - 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 ffsl __something_else -#include <string.h> - -#undef ffs - -#if defined (__GNUC__) && defined (__mc68020__) - -int -__ffs (x) - int x; -{ - int cnt; - - asm ("bfffo %1{#0:#0},%0" : "=d" (cnt) : "dm" (x & -x)); - - return 32 - cnt; -} -weak_alias (__ffs, ffs) -libc_hidden_builtin_def (ffs) -#undef ffsl -weak_alias (__ffs, ffsl) - -#else - -#include <string/ffs.c> - -#endif diff --git a/sysdeps/m68k/fpu/Makefile b/sysdeps/m68k/fpu/Makefile deleted file mode 100644 index 42db6381d3..0000000000 --- a/sysdeps/m68k/fpu/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -ifeq ($(subdir),math) -ifndef math-twiddled - -# Avoid twiddling in generic/Makefile. -math-twiddled := t - -endif - -bsdmath_dirs := $(bsdmath_dirs) mc68881 - -endif diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h deleted file mode 100644 index 7c0bcb6697..0000000000 --- a/sysdeps/m68k/fpu/bits/fenv.h +++ /dev/null @@ -1,79 +0,0 @@ -/* 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 <bits/fenv.h> directly; include <fenv.h> 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/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h deleted file mode 100644 index acbac47aac..0000000000 --- a/sysdeps/m68k/fpu/bits/mathinline.h +++ /dev/null @@ -1,445 +0,0 @@ -/* Definitions of inline math functions implemented by the m68881/2. - Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004 - 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. */ - -#ifdef __GNUC__ - -#ifdef __USE_ISOC99 -/* GCC 3.1 and up have builtins that actually can be used. */ -# if !__GNUC_PREREQ (3,1) -/* ISO C99 defines some macros to perform unordered comparisons. The - m68k FPU supports this with special opcodes and we should use them. - These must not be inline functions since we have to be able to handle - all floating-point types. */ -# undef isgreater -# undef isgreaterequal -# undef isless -# undef islessequal -# undef islessgreater -# undef isunordered -# define isgreater(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsogt %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) - -# define isgreaterequal(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsoge %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) - -# define isless(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsolt %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) - -# define islessequal(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsole %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) - -# define islessgreater(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsogl %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) - -# define isunordered(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsun %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - __result != 0; }) -# endif /* GCC 3.1 */ -#endif - - -#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \ - || defined __LIBC_INTERNAL_MATH_INLINES - -#ifdef __LIBC_INTERNAL_MATH_INLINES -/* This is used when defining the functions themselves. Define them with - __ names, and with `static inline' instead of `extern inline' so the - bodies will always be used, never an external function call. */ -# define __m81_u(x) __CONCAT(__,x) -# define __m81_inline static __inline -#else -# define __m81_u(x) x -# ifdef __cplusplus -# define __m81_inline __inline -# else -# define __m81_inline extern __inline -# endif -# define __M81_MATH_INLINES 1 -#endif - -/* Define a const math function. */ -#define __m81_defun(rettype, func, args) \ - __m81_inline rettype __attribute__((__const__)) \ - __m81_u(func) args - -/* Define the three variants of a math function that has a direct - implementation in the m68k fpu. FUNC is the name for C (which will be - suffixed with f and l for the float and long double version, resp). OP - is the name of the fpu operation (without leading f). */ - -#if defined __USE_MISC || defined __USE_ISOC99 -# define __inline_mathop(func, op) \ - __inline_mathop1(double, func, op) \ - __inline_mathop1(float, __CONCAT(func,f), op) \ - __inline_mathop1(long double, __CONCAT(func,l), op) -#else -# define __inline_mathop(func, op) \ - __inline_mathop1(double, func, op) -#endif - -#define __inline_mathop1(float_type,func, op) \ - __m81_defun (float_type, func, (float_type __mathop_x)) \ - { \ - float_type __result; \ - __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\ - return __result; \ - } - -__inline_mathop(__atan, atan) -__inline_mathop(__cos, cos) -__inline_mathop(__sin, sin) -__inline_mathop(__tan, tan) -__inline_mathop(__tanh, tanh) -__inline_mathop(__fabs, abs) - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -__inline_mathop(__rint, int) -__inline_mathop(__expm1, etoxm1) -__inline_mathop(__log1p, lognp1) -#endif - -#ifdef __USE_MISC -__inline_mathop(__significand, getman) -#endif - -#ifdef __USE_ISOC99 -__inline_mathop(__trunc, intrz) -#endif - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -__inline_mathop(atan, atan) -__inline_mathop(cos, cos) -__inline_mathop(sin, sin) -__inline_mathop(tan, tan) -__inline_mathop(tanh, tanh) - -# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -__inline_mathop(rint, int) -__inline_mathop(expm1, etoxm1) -__inline_mathop(log1p, lognp1) -# endif - -# ifdef __USE_MISC -__inline_mathop(significand, getman) -# endif - -# ifdef __USE_ISOC99 -__inline_mathop(trunc, intrz) -# endif - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -/* This macro contains the definition for the rest of the inline - functions, using FLOAT_TYPE as the domain type and S as the suffix - for the function names. */ - -#define __inline_functions(float_type, s) \ -__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards negative infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ - /* Convert X to an integer, using -Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards positive infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg | 0x30)); \ - /* Convert X to an integer, using +Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} - -__inline_functions(double,) -#if defined __USE_MISC || defined __USE_ISOC99 -__inline_functions(float,f) -__inline_functions(long double,l) -#endif -#undef __inline_functions - -#ifdef __USE_MISC - -# define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for infinity, \ - so we must extract and examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ -} \ - \ -__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for infinity, so we must extract and \ - examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (3 << 24)) == 0; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__scalbn,s), \ - (float_type __x, int __n)) \ -{ \ - float_type __result; \ - __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ - return __result; \ -} - -__inline_functions(double,) -__inline_functions(float,f) -__inline_functions(long double,l) -# undef __inline_functions - -#endif /* Use misc. */ - -#if defined __USE_MISC || defined __USE_XOPEN - -# define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ -{ \ - char __result; \ - __asm("ftst%.x %1\n" \ - "fsun %0" : "=dm" (__result) : "f" (__value)); \ - return __result; \ -} - -__inline_functions(double,) -# ifdef __USE_MISC -__inline_functions(float,f) -__inline_functions(long double,l) -# endif -# undef __inline_functions - -#endif - -#ifdef __USE_ISOC99 - -# define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for the sign bit, so we must extract \ - and examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr >> 27) & 1; \ -} \ - \ - __m81_defun (float_type, __CONCAT(__scalbln,s), \ - (float_type __x, long int __n)) \ -{ \ - return __CONCAT(__scalbn,s) (__x, __n); \ -} \ - \ -__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Temporarily disable the inexact exception. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg & ~0x200)); \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \ -{ \ - long int __result; \ - __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \ - return __result; \ -} \ - \ -__m81_inline float_type \ -__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \ - float_type __z) \ -{ \ - return (__x * __y) + __z; \ -} - -__inline_functions (double,) -__inline_functions (float,f) -__inline_functions (long double,l) -# undef __inline_functions - -#endif /* Use ISO C9x */ - -#ifdef __USE_GNU - -# define __inline_functions(float_type, s) \ -__m81_inline void \ -__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ - float_type *__cosx) \ -{ \ - __asm ("fsincos%.x %2,%1:%0" \ - : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ -} - -__inline_functions (double,) -__inline_functions (float,f) -__inline_functions (long double,l) -# undef __inline_functions - -#endif - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Define inline versions of the user visible functions. */ - -/* Note that there must be no whitespace before the argument passed for - NAME, to make token pasting work correctly with -traditional. */ -# define __inline_forward_c(rettype, name, args1, args2) \ -extern __inline rettype __attribute__((__const__)) \ - name args1 \ -{ \ - return __CONCAT(__,name) args2; \ -} - -# define __inline_forward(rettype, name, args1, args2) \ -extern __inline rettype name args1 \ -{ \ - return __CONCAT(__,name) args2; \ -} - -__inline_forward_c(double,floor, (double __x), (__x)) -__inline_forward_c(double,ceil, (double __x), (__x)) -# ifdef __USE_MISC -# ifndef __USE_ISOC99 /* Conflict with macro of same name. */ -__inline_forward_c(int,isinf, (double __value), (__value)) -# endif -__inline_forward_c(int,finite, (double __value), (__value)) -__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n)) -# endif -# if defined __USE_MISC || defined __USE_XOPEN -# ifndef __USE_ISOC99 /* Conflict with macro of same name. */ -__inline_forward_c(int,isnan, (double __value), (__value)) -# endif -# endif -# ifdef __USE_ISOC99 -__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n)) -__inline_forward_c(double,nearbyint, (double __value), (__value)) -__inline_forward_c(long int,lrint, (double __value), (__value)) -__inline_forward_c(double,fma, (double __x, double __y, double __z), - (__x, __y, __z)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx), - (__x, __sinx, __cosx)) -# endif - -# if defined __USE_MISC || defined __USE_ISOC99 - -__inline_forward_c(float,floorf, (float __x), (__x)) -__inline_forward_c(float,ceilf, (float __x), (__x)) -# ifdef __USE_MISC -__inline_forward_c(int,isinff, (float __value), (__value)) -__inline_forward_c(int,finitef, (float __value), (__value)) -__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n)) -__inline_forward_c(int,isnanf, (float __value), (__value)) -# endif -# ifdef __USE_ISOC99 -__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n)) -__inline_forward_c(float,nearbyintf, (float __value), (__value)) -__inline_forward_c(long int,lrintf, (float __value), (__value)) -__inline_forward_c(float,fmaf, (float __x, float __y, float __z), - (__x, __y, __z)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx), - (__x, __sinx, __cosx)) -# endif - -__inline_forward_c(long double,floorl, (long double __x), (__x)) -__inline_forward_c(long double,ceill, (long double __x), (__x)) -# ifdef __USE_MISC -__inline_forward_c(int,isinfl, (long double __value), (__value)) -__inline_forward_c(int,finitel, (long double __value), (__value)) -__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n)) -__inline_forward_c(int,isnanl, (long double __value), (__value)) -# endif -# ifdef __USE_ISOC99 -__inline_forward_c(long double,scalblnl, (long double __x, long int __n), - (__x, __n)) -__inline_forward_c(long double,nearbyintl, (long double __value), (__value)) -__inline_forward_c(long int,lrintl, (long double __value), (__value)) -__inline_forward_c(long double,fmal, - (long double __x, long double __y, long double __z), - (__x, __y, __z)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincosl, - (long double __x, long double *__sinx, long double *__cosx), - (__x, __sinx, __cosx)) -# endif - -#endif /* Use misc or ISO C99 */ - -#undef __inline_forward -#undef __inline_forward_c - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -#endif -#endif /* GCC. */ diff --git a/sysdeps/m68k/fpu/branred.c b/sysdeps/m68k/fpu/branred.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/branred.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/doasin.c b/sysdeps/m68k/fpu/doasin.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/doasin.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/dosincos.c b/sysdeps/m68k/fpu/dosincos.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/dosincos.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/e_acos.c b/sysdeps/m68k/fpu/e_acos.c deleted file mode 100644 index c9f6c6a162..0000000000 --- a/sysdeps/m68k/fpu/e_acos.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "math_private.h" -#include "mathimpl.h" - -#ifndef FUNC -#define FUNC __ieee754_acos -#endif -#ifndef float_type -#define float_type double -#endif - -float_type -FUNC (x) - float_type x; -{ - return __m81_u(FUNC)(x); -} diff --git a/sysdeps/m68k/fpu/e_acosf.c b/sysdeps/m68k/fpu/e_acosf.c deleted file mode 100644 index 90665082d3..0000000000 --- a/sysdeps/m68k/fpu/e_acosf.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC __ieee754_acosf -#endif -#define float_type float -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_acosl.c b/sysdeps/m68k/fpu/e_acosl.c deleted file mode 100644 index e3dcd170f3..0000000000 --- a/sysdeps/m68k/fpu/e_acosl.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC __ieee754_acosl -#endif -#define float_type long double -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_asin.c b/sysdeps/m68k/fpu/e_asin.c deleted file mode 100644 index b6176c708a..0000000000 --- a/sysdeps/m68k/fpu/e_asin.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_asin -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_asinf.c b/sysdeps/m68k/fpu/e_asinf.c deleted file mode 100644 index 05fb82670b..0000000000 --- a/sysdeps/m68k/fpu/e_asinf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_asinf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_asinl.c b/sysdeps/m68k/fpu/e_asinl.c deleted file mode 100644 index 0dd89fb9da..0000000000 --- a/sysdeps/m68k/fpu/e_asinl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_asinl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_atan2.c b/sysdeps/m68k/fpu/e_atan2.c deleted file mode 100644 index 551b14db81..0000000000 --- a/sysdeps/m68k/fpu/e_atan2.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "math_private.h" -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -float_type -s(__ieee754_atan2) (float_type y, float_type x) -{ - float_type pi, pi_2, z; - unsigned long y_cond, x_cond; - - __asm ("fmovecr%.x %#0, %0" : "=f" (pi)); - __asm ("fscale%.w %#-1, %0" : "=f" (pi_2) : "0" (pi)); - y_cond = __m81_test (y); - x_cond = __m81_test (x); - - if ((x_cond | y_cond) & __M81_COND_NAN) - z = x + y; - else if (y_cond & __M81_COND_ZERO) - { - if (x_cond & __M81_COND_NEG) - z = y_cond & __M81_COND_NEG ? -pi : pi; - else - z = y; - } - else if (x_cond & __M81_COND_INF) - { - if (y_cond & __M81_COND_INF) - { - float_type pi_4; - __asm ("fscale%.w %#-2, %0" : "=f" (pi_4) : "0" (pi)); - z = x_cond & __M81_COND_NEG ? 3 * pi_4 : pi_4; - } - else - z = x_cond & __M81_COND_NEG ? pi : 0; - if (y_cond & __M81_COND_NEG) - z = -z; - } - else if (y_cond & __M81_COND_INF) - z = y_cond & __M81_COND_NEG ? -pi_2 : pi_2; - else if (x_cond & __M81_COND_NEG) - { - if (y_cond & __M81_COND_NEG) - { - if (-x > -y) - z = -pi + m81(__atan) (y / x); - else - z = -pi_2 - m81(__atan) (x / y); - } - else - { - if (-x > y) - z = pi + m81(__atan) (y / x); - else - z = pi_2 - m81(__atan) (x / y); - } - } - else - { - if (y_cond & __M81_COND_NEG) - { - if (x > -y) - z = m81(__atan) (y / x); - else - z = -pi_2 - m81(__atan) (x / y); - } - else - { - if (x > y) - z = m81(__atan) (y / x); - else - z = pi_2 - m81(__atan) (x / y); - } - } - return z; -} diff --git a/sysdeps/m68k/fpu/e_atan2f.c b/sysdeps/m68k/fpu/e_atan2f.c deleted file mode 100644 index a0c750a759..0000000000 --- a/sysdeps/m68k/fpu/e_atan2f.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <e_atan2.c> diff --git a/sysdeps/m68k/fpu/e_atan2l.c b/sysdeps/m68k/fpu/e_atan2l.c deleted file mode 100644 index 426ca94baa..0000000000 --- a/sysdeps/m68k/fpu/e_atan2l.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <e_atan2.c> diff --git a/sysdeps/m68k/fpu/e_atanh.c b/sysdeps/m68k/fpu/e_atanh.c deleted file mode 100644 index 11bf430686..0000000000 --- a/sysdeps/m68k/fpu/e_atanh.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_atanh -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_atanhf.c b/sysdeps/m68k/fpu/e_atanhf.c deleted file mode 100644 index 7a8f92ecf3..0000000000 --- a/sysdeps/m68k/fpu/e_atanhf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_atanhf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_atanhl.c b/sysdeps/m68k/fpu/e_atanhl.c deleted file mode 100644 index d8975d6782..0000000000 --- a/sysdeps/m68k/fpu/e_atanhl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_atanhl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_cosh.c b/sysdeps/m68k/fpu/e_cosh.c deleted file mode 100644 index 93d753c519..0000000000 --- a/sysdeps/m68k/fpu/e_cosh.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_cosh -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_coshf.c b/sysdeps/m68k/fpu/e_coshf.c deleted file mode 100644 index 433faf17b9..0000000000 --- a/sysdeps/m68k/fpu/e_coshf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_coshf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_coshl.c b/sysdeps/m68k/fpu/e_coshl.c deleted file mode 100644 index 39144fd202..0000000000 --- a/sysdeps/m68k/fpu/e_coshl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_coshl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_exp.c b/sysdeps/m68k/fpu/e_exp.c deleted file mode 100644 index 1e95ac474d..0000000000 --- a/sysdeps/m68k/fpu/e_exp.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_exp10.c b/sysdeps/m68k/fpu/e_exp10.c deleted file mode 100644 index a1dd224470..0000000000 --- a/sysdeps/m68k/fpu/e_exp10.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp10 -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_exp10f.c b/sysdeps/m68k/fpu/e_exp10f.c deleted file mode 100644 index 1b78bc3723..0000000000 --- a/sysdeps/m68k/fpu/e_exp10f.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp10f -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_exp10l.c b/sysdeps/m68k/fpu/e_exp10l.c deleted file mode 100644 index 5e901999fa..0000000000 --- a/sysdeps/m68k/fpu/e_exp10l.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp10l -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_exp2.c b/sysdeps/m68k/fpu/e_exp2.c deleted file mode 100644 index 24fac4fce6..0000000000 --- a/sysdeps/m68k/fpu/e_exp2.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp2 -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_exp2f.c b/sysdeps/m68k/fpu/e_exp2f.c deleted file mode 100644 index 593842e4e5..0000000000 --- a/sysdeps/m68k/fpu/e_exp2f.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp2f -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_exp2l.c b/sysdeps/m68k/fpu/e_exp2l.c deleted file mode 100644 index 0ab2a428c0..0000000000 --- a/sysdeps/m68k/fpu/e_exp2l.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_exp2l -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_expf.c b/sysdeps/m68k/fpu/e_expf.c deleted file mode 100644 index 2aeaacfab9..0000000000 --- a/sysdeps/m68k/fpu/e_expf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_expf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_expl.c b/sysdeps/m68k/fpu/e_expl.c deleted file mode 100644 index 8805a1b83a..0000000000 --- a/sysdeps/m68k/fpu/e_expl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_expl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_fmod.c b/sysdeps/m68k/fpu/e_fmod.c deleted file mode 100644 index bd229ae4b0..0000000000 --- a/sysdeps/m68k/fpu/e_fmod.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "math_private.h" -#include "mathimpl.h" - -#ifndef FUNC -#define FUNC __ieee754_fmod -#endif -#ifndef float_type -#define float_type double -#endif - -float_type -FUNC (x, y) - float_type x; - float_type y; -{ - return __m81_u(FUNC)(x, y); -} diff --git a/sysdeps/m68k/fpu/e_fmodf.c b/sysdeps/m68k/fpu/e_fmodf.c deleted file mode 100644 index 88c350ce9e..0000000000 --- a/sysdeps/m68k/fpu/e_fmodf.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC __ieee754_fmodf -#endif -#define float_type float -#include <e_fmod.c> diff --git a/sysdeps/m68k/fpu/e_fmodl.c b/sysdeps/m68k/fpu/e_fmodl.c deleted file mode 100644 index a46f19ea9d..0000000000 --- a/sysdeps/m68k/fpu/e_fmodl.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC __ieee754_fmodl -#endif -#define float_type long double -#include <e_fmod.c> diff --git a/sysdeps/m68k/fpu/e_log.c b/sysdeps/m68k/fpu/e_log.c deleted file mode 100644 index 146dc0c784..0000000000 --- a/sysdeps/m68k/fpu/e_log.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_log10.c b/sysdeps/m68k/fpu/e_log10.c deleted file mode 100644 index 06a9b87cb9..0000000000 --- a/sysdeps/m68k/fpu/e_log10.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log10 -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_log10f.c b/sysdeps/m68k/fpu/e_log10f.c deleted file mode 100644 index 3896864ecb..0000000000 --- a/sysdeps/m68k/fpu/e_log10f.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log10f -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_log10l.c b/sysdeps/m68k/fpu/e_log10l.c deleted file mode 100644 index 6dcfc5a101..0000000000 --- a/sysdeps/m68k/fpu/e_log10l.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log10l -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_log2.c b/sysdeps/m68k/fpu/e_log2.c deleted file mode 100644 index 5528922b9c..0000000000 --- a/sysdeps/m68k/fpu/e_log2.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log2 -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_log2f.c b/sysdeps/m68k/fpu/e_log2f.c deleted file mode 100644 index 6b4907686d..0000000000 --- a/sysdeps/m68k/fpu/e_log2f.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log2f -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_log2l.c b/sysdeps/m68k/fpu/e_log2l.c deleted file mode 100644 index 4c92a11acf..0000000000 --- a/sysdeps/m68k/fpu/e_log2l.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_log2l -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_logf.c b/sysdeps/m68k/fpu/e_logf.c deleted file mode 100644 index bc23217c38..0000000000 --- a/sysdeps/m68k/fpu/e_logf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_logf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_logl.c b/sysdeps/m68k/fpu/e_logl.c deleted file mode 100644 index 03b1830759..0000000000 --- a/sysdeps/m68k/fpu/e_logl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_logl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_pow.c b/sysdeps/m68k/fpu/e_pow.c deleted file mode 100644 index 0b6cee6f15..0000000000 --- a/sysdeps/m68k/fpu/e_pow.c +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "math_private.h" -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -float_type -s(__ieee754_pow) (float_type x, float_type y) -{ - float_type z; - float_type ax; - unsigned long x_cond, y_cond; - - y_cond = __m81_test (y); - if (y_cond & __M81_COND_ZERO) - return 1.0; - if (y_cond & __M81_COND_NAN) - return x == 1.0 ? x : x + y; - - x_cond = __m81_test (x); - if (x_cond & __M81_COND_NAN) - return x + y; - - if (y_cond & __M81_COND_INF) - { - ax = s(fabs) (x); - if (ax == 1.0) - return ax; - if (ax > 1.0) - return y_cond & __M81_COND_NEG ? 0 : y; - else - return y_cond & __M81_COND_NEG ? -y : 0; - } - - if (s(fabs) (y) == 1.0) - return y_cond & __M81_COND_NEG ? 1 / x : x; - - if (y == 2) - return x * x; - if (y == 0.5 && !(x_cond & __M81_COND_NEG)) - return m81(__ieee754_sqrt) (x); - - if (x == 10.0) - { - __asm ("ftentox%.x %1, %0" : "=f" (z) : "f" (y)); - return z; - } - if (x == 2.0) - { - __asm ("ftwotox%.x %1, %0" : "=f" (z) : "f" (y)); - return z; - } - - ax = s(fabs) (x); - if (x_cond & (__M81_COND_INF | __M81_COND_ZERO) || ax == 1.0) - { - z = ax; - if (y_cond & __M81_COND_NEG) - z = 1 / z; - if (x_cond & __M81_COND_NEG) - { - if (y != m81(__rint) (y)) - { - if (x == -1) - z = (z - z) / (z - z); - } - else - goto maybe_negate; - } - return z; - } - - if (x_cond & __M81_COND_NEG) - { - if (y == m81(__rint) (y)) - { - z = m81(__ieee754_exp) (y * m81(__ieee754_log) (-x)); - maybe_negate: - /* We always use the long double format, since y is already in - this format and rounding won't change the result. */ - { - int32_t exponent; - u_int32_t i0, i1; - GET_LDOUBLE_WORDS (exponent, i0, i1, y); - exponent = (exponent & 0x7fff) - 0x3fff; - if (exponent <= 31 - ? i0 & (1 << (31 - exponent)) - : (exponent <= 63 - && i1 & (1 << (63 - exponent)))) - z = -z; - } - } - else - z = (y - y) / (y - y); - } - else - z = m81(__ieee754_exp) (y * m81(__ieee754_log) (x)); - return z; -} diff --git a/sysdeps/m68k/fpu/e_powf.c b/sysdeps/m68k/fpu/e_powf.c deleted file mode 100644 index 379014355a..0000000000 --- a/sysdeps/m68k/fpu/e_powf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <e_pow.c> diff --git a/sysdeps/m68k/fpu/e_powl.c b/sysdeps/m68k/fpu/e_powl.c deleted file mode 100644 index f71fa34a26..0000000000 --- a/sysdeps/m68k/fpu/e_powl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <e_pow.c> diff --git a/sysdeps/m68k/fpu/e_rem_pio2.c b/sysdeps/m68k/fpu/e_rem_pio2.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/e_rem_pio2.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/e_rem_pio2f.c b/sysdeps/m68k/fpu/e_rem_pio2f.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/e_rem_pio2f.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/e_rem_pio2l.c b/sysdeps/m68k/fpu/e_rem_pio2l.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/e_rem_pio2l.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/e_remainder.c b/sysdeps/m68k/fpu/e_remainder.c deleted file mode 100644 index aa31bc011e..0000000000 --- a/sysdeps/m68k/fpu/e_remainder.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_remainder -#include <e_fmod.c> diff --git a/sysdeps/m68k/fpu/e_remainderf.c b/sysdeps/m68k/fpu/e_remainderf.c deleted file mode 100644 index b04f0c87c2..0000000000 --- a/sysdeps/m68k/fpu/e_remainderf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_remainderf -#include <e_fmodf.c> diff --git a/sysdeps/m68k/fpu/e_remainderl.c b/sysdeps/m68k/fpu/e_remainderl.c deleted file mode 100644 index b9dc540cc5..0000000000 --- a/sysdeps/m68k/fpu/e_remainderl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_remainderl -#include <e_fmodl.c> diff --git a/sysdeps/m68k/fpu/e_scalb.c b/sysdeps/m68k/fpu/e_scalb.c deleted file mode 100644 index 88edba1ca8..0000000000 --- a/sysdeps/m68k/fpu/e_scalb.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <math.h> -#include "math_private.h" -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -float_type -s(__ieee754_scalb) (float_type x, float_type fn) -{ - float_type retval; - unsigned long x_cond = __m81_test (x); - unsigned long fn_cond = __m81_test (fn); - - if ((x_cond | fn_cond) & __M81_COND_NAN) - return x * fn; - - if (fn_cond & __M81_COND_INF) - { - if (!(fn_cond & __M81_COND_NEG)) - return x * fn; - else if (x_cond & __M81_COND_ZERO) - return x; - else - return x / -fn; - } - - if (m81(__rint) (fn) != fn) - return (x - x) / (x - x); - - __asm ("fscale%.x %1, %0" : "=f" (retval) : "f" (fn), "0" (x)); - return retval; -} diff --git a/sysdeps/m68k/fpu/e_scalbf.c b/sysdeps/m68k/fpu/e_scalbf.c deleted file mode 100644 index 7943571246..0000000000 --- a/sysdeps/m68k/fpu/e_scalbf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <e_scalb.c> diff --git a/sysdeps/m68k/fpu/e_scalbl.c b/sysdeps/m68k/fpu/e_scalbl.c deleted file mode 100644 index 35fb2dc0ed..0000000000 --- a/sysdeps/m68k/fpu/e_scalbl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <e_scalb.c> diff --git a/sysdeps/m68k/fpu/e_sinh.c b/sysdeps/m68k/fpu/e_sinh.c deleted file mode 100644 index c6fed7ff46..0000000000 --- a/sysdeps/m68k/fpu/e_sinh.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sinh -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_sinhf.c b/sysdeps/m68k/fpu/e_sinhf.c deleted file mode 100644 index b5034b7b0e..0000000000 --- a/sysdeps/m68k/fpu/e_sinhf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sinhf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_sinhl.c b/sysdeps/m68k/fpu/e_sinhl.c deleted file mode 100644 index 2f42d96a38..0000000000 --- a/sysdeps/m68k/fpu/e_sinhl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sinhl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/e_sqrt.c b/sysdeps/m68k/fpu/e_sqrt.c deleted file mode 100644 index 70f19710cc..0000000000 --- a/sysdeps/m68k/fpu/e_sqrt.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sqrt -#include <e_acos.c> diff --git a/sysdeps/m68k/fpu/e_sqrtf.c b/sysdeps/m68k/fpu/e_sqrtf.c deleted file mode 100644 index 5dc1904cb6..0000000000 --- a/sysdeps/m68k/fpu/e_sqrtf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sqrtf -#include <e_acosf.c> diff --git a/sysdeps/m68k/fpu/e_sqrtl.c b/sysdeps/m68k/fpu/e_sqrtl.c deleted file mode 100644 index fede1024a2..0000000000 --- a/sysdeps/m68k/fpu/e_sqrtl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC __ieee754_sqrtl -#include <e_acosl.c> diff --git a/sysdeps/m68k/fpu/fclrexcpt.c b/sysdeps/m68k/fpu/fclrexcpt.c deleted file mode 100644 index bcd7a3fe52..0000000000 --- a/sysdeps/m68k/fpu/fclrexcpt.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Clear given exceptions in current 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 <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -int -__feclearexcept (int excepts) -{ - fexcept_t fpsr; - - /* Mask out unsupported bits/exceptions. */ - excepts &= FE_ALL_EXCEPT; - - /* Fetch the fpu status register. */ - __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr)); - - /* Clear the relevant bits. */ - fpsr &= ~excepts; - - /* Put the new data in effect. */ - __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr)); - - /* Success. */ - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__feclearexcept, __old_feclearexcept) -compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1); -#endif - -versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fedisblxcpt.c b/sysdeps/m68k/fpu/fedisblxcpt.c deleted file mode 100644 index 416e0ba464..0000000000 --- a/sysdeps/m68k/fpu/fedisblxcpt.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>, 2000. - - 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 <fenv.h> - -int -fedisableexcept (int excepts) -{ - unsigned int old_exc, new_exc; - - /* Get the current control register contents. */ - __asm__ ("fmove%.l %!,%0" : "=dm" (new_exc)); - - old_exc = (new_exc >> 6) & FE_ALL_EXCEPT; - - excepts &= FE_ALL_EXCEPT; - - new_exc &= ~(excepts << 6); - __asm__ ("fmove%.l %0,%!" : : "dm" (new_exc)); - - return old_exc; -} diff --git a/sysdeps/m68k/fpu/feenablxcpt.c b/sysdeps/m68k/fpu/feenablxcpt.c deleted file mode 100644 index f963acf01d..0000000000 --- a/sysdeps/m68k/fpu/feenablxcpt.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>, 2000. - - 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 <fenv.h> - -int -feenableexcept (int excepts) -{ - unsigned int new_exc, old_exc; - - /* Get the current control register contents. */ - __asm__ ("fmove%.l %!,%0" : "=dm" (new_exc)); - - old_exc = (new_exc >> 6) & FE_ALL_EXCEPT; - - excepts &= FE_ALL_EXCEPT; - - new_exc |= excepts << 6; - __asm__ ("fmove%.l %0,%!" : : "dm" (new_exc)); - - return old_exc; -} diff --git a/sysdeps/m68k/fpu/fegetenv.c b/sysdeps/m68k/fpu/fegetenv.c deleted file mode 100644 index 6c94b07318..0000000000 --- a/sysdeps/m68k/fpu/fegetenv.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Store current 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 <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -int -__fegetenv (fenv_t *envp) -{ - __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp)); - - /* Success. */ - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__fegetenv, __old_fegetenv) -compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1); -#endif - -versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fegetround.c b/sysdeps/m68k/fpu/fegetround.c deleted file mode 100644 index 74fc56f745..0000000000 --- a/sysdeps/m68k/fpu/fegetround.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Return current rounding direction. - Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -int -fegetround (void) -{ - int fpcr; - - __asm__ ("fmove%.l %!,%0" : "=dm" (fpcr)); - - return fpcr & FE_UPWARD; -} diff --git a/sysdeps/m68k/fpu/feholdexcpt.c b/sysdeps/m68k/fpu/feholdexcpt.c deleted file mode 100644 index 88fb1c59ac..0000000000 --- a/sysdeps/m68k/fpu/feholdexcpt.c +++ /dev/null @@ -1,39 +0,0 @@ -/* 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 <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -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/sysdeps/m68k/fpu/fesetenv.c b/sysdeps/m68k/fpu/fesetenv.c deleted file mode 100644 index 20653f0ddc..0000000000 --- a/sysdeps/m68k/fpu/fesetenv.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -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 <shlib-compat.h> -#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 - -libm_hidden_ver (__fesetenv, fesetenv) -versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fesetround.c b/sysdeps/m68k/fpu/fesetround.c deleted file mode 100644 index 956325de8a..0000000000 --- a/sysdeps/m68k/fpu/fesetround.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -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/sysdeps/m68k/fpu/feupdateenv.c b/sysdeps/m68k/fpu/feupdateenv.c deleted file mode 100644 index 2a6831387e..0000000000 --- a/sysdeps/m68k/fpu/feupdateenv.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -int -__feupdateenv (const fenv_t *envp) -{ - fexcept_t fpsr; - - /* Save current exceptions. */ - __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr)); - fpsr &= FE_ALL_EXCEPT; - - /* Install new environment. */ - fesetenv (envp); - - /* Raise the saved exception. Incidently for us the implementation - defined format of the values in objects of type fexcept_t is the - same as the ones specified using the FE_* constants. */ - feraiseexcept ((int) fpsr); - - /* Success. */ - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__feupdateenv, __old_feupdateenv) -compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1); -#endif - -versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fgetexcptflg.c b/sysdeps/m68k/fpu/fgetexcptflg.c deleted file mode 100644 index 764b900c0b..0000000000 --- a/sysdeps/m68k/fpu/fgetexcptflg.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -int -__fegetexceptflag (fexcept_t *flagp, int excepts) -{ - fexcept_t fpsr; - - /* Get the current exceptions. */ - __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr)); - - *flagp = fpsr & excepts & FE_ALL_EXCEPT; - - /* Success. */ - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__fegetexceptflag, __old_fegetexceptflag) -compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1); -#endif - -versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fraiseexcpt.c b/sysdeps/m68k/fpu/fraiseexcpt.c deleted file mode 100644 index 69f746c9b2..0000000000 --- a/sysdeps/m68k/fpu/fraiseexcpt.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> -#include <float.h> -#include <math.h> - -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 <shlib-compat.h> -#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 - -libm_hidden_ver (__feraiseexcept, feraiseexcept) -versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/fsetexcptflg.c b/sysdeps/m68k/fpu/fsetexcptflg.c deleted file mode 100644 index 51b086a8f2..0000000000 --- a/sysdeps/m68k/fpu/fsetexcptflg.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> -#include <math.h> - -int -__fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - fexcept_t fpsr; - - /* Get the current status register. */ - __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr)); - - /* Install the new exception bits in the Accrued Exception Byte. */ - fpsr &= ~(excepts & FE_ALL_EXCEPT); - fpsr |= *flagp & excepts & FE_ALL_EXCEPT; - - /* Store the new status register. */ - __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr)); - - /* Success. */ - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__fesetexceptflag, __old_fesetexceptflag) -compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1); -#endif - -versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2); diff --git a/sysdeps/m68k/fpu/ftestexcept.c b/sysdeps/m68k/fpu/ftestexcept.c deleted file mode 100644 index 3157c90d1a..0000000000 --- a/sysdeps/m68k/fpu/ftestexcept.c +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 <schwab@issan.informatik.uni-dortmund.de> - - 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 <fenv.h> - -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/sysdeps/m68k/fpu/halfulp.c b/sysdeps/m68k/fpu/halfulp.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/halfulp.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/k_cos.c b/sysdeps/m68k/fpu/k_cos.c deleted file mode 100644 index dd6c215c23..0000000000 --- a/sysdeps/m68k/fpu/k_cos.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1996, 1997 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 <math.h> -#include "math_private.h" - -#ifndef FUNC -#define FUNC cos -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__kernel_,FUNC) (x, y) - float_type x; - float_type y; -{ - float_type sin_x, cos_x, sin_y, cos_y; - __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_x), "=f" (sin_x) - : "f" (x)); - __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_y), "=f" (sin_y) - : "f" (y)); - return cos_x * cos_y - sin_x * sin_y; -} diff --git a/sysdeps/m68k/fpu/k_cosf.c b/sysdeps/m68k/fpu/k_cosf.c deleted file mode 100644 index 2a366d094b..0000000000 --- a/sysdeps/m68k/fpu/k_cosf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC cosf -#define float_type float -#include <k_cos.c> diff --git a/sysdeps/m68k/fpu/k_cosl.c b/sysdeps/m68k/fpu/k_cosl.c deleted file mode 100644 index 983b66544c..0000000000 --- a/sysdeps/m68k/fpu/k_cosl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC cosl -#define float_type long double -#include <k_cos.c> diff --git a/sysdeps/m68k/fpu/k_rem_pio2.c b/sysdeps/m68k/fpu/k_rem_pio2.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/k_rem_pio2.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/k_rem_pio2f.c b/sysdeps/m68k/fpu/k_rem_pio2f.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/k_rem_pio2f.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/k_rem_pio2l.c b/sysdeps/m68k/fpu/k_rem_pio2l.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/m68k/fpu/k_rem_pio2l.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c deleted file mode 100644 index 652ca0e131..0000000000 --- a/sysdeps/m68k/fpu/k_sin.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 1996, 1997 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 <math.h> -#include "math_private.h" - -#ifndef FUNC -#define FUNC sin -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__kernel_,FUNC) (x, y, iy) - float_type x; - float_type y; - int iy; -{ - float_type sin_x, cos_x, sin_y, cos_y; - if (iy == 0) - return __m81_u(__CONCATX(__,FUNC)) (x); - __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_x), "=f" (sin_x) - : "f" (x)); - __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_y), "=f" (sin_y) - : "f" (y)); - return sin_x * cos_y + cos_x * sin_y; -} diff --git a/sysdeps/m68k/fpu/k_sinf.c b/sysdeps/m68k/fpu/k_sinf.c deleted file mode 100644 index 7050347c4b..0000000000 --- a/sysdeps/m68k/fpu/k_sinf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC sinf -#define float_type float -#include <k_sin.c> diff --git a/sysdeps/m68k/fpu/k_sinl.c b/sysdeps/m68k/fpu/k_sinl.c deleted file mode 100644 index 5a647cafd7..0000000000 --- a/sysdeps/m68k/fpu/k_sinl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC sinl -#define float_type long double -#include <k_sin.c> diff --git a/sysdeps/m68k/fpu/k_tan.c b/sysdeps/m68k/fpu/k_tan.c deleted file mode 100644 index 28f6a80cf5..0000000000 --- a/sysdeps/m68k/fpu/k_tan.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1996, 1997 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 <math.h> -#include "math_private.h" - -#ifndef FUNC -#define FUNC tan -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__kernel_,FUNC) (x, y, iy) - float_type x; - float_type y; - int iy; -{ - float_type tan_x, tan_y; - tan_x = __m81_u(__CONCATX(__,FUNC)) (x); - tan_y = __m81_u(__CONCATX(__,FUNC)) (y); - if (iy > 0) - return (tan_x + tan_y) / (1 - tan_x * tan_y); - else - return (tan_x * tan_y - 1) / (tan_x + tan_y); -} diff --git a/sysdeps/m68k/fpu/k_tanf.c b/sysdeps/m68k/fpu/k_tanf.c deleted file mode 100644 index 777af1bf13..0000000000 --- a/sysdeps/m68k/fpu/k_tanf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC tanf -#define float_type float -#include <k_tan.c> diff --git a/sysdeps/m68k/fpu/k_tanl.c b/sysdeps/m68k/fpu/k_tanl.c deleted file mode 100644 index f2570e681f..0000000000 --- a/sysdeps/m68k/fpu/k_tanl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC tanl -#define float_type long double -#include <k_tan.c> diff --git a/sysdeps/m68k/fpu/libm-test-ulps b/sysdeps/m68k/fpu/libm-test-ulps deleted file mode 100644 index 854c10cb1a..0000000000 --- a/sysdeps/m68k/fpu/libm-test-ulps +++ /dev/null @@ -1,1165 +0,0 @@ -# Begin of automatic generation - -# acosh -Test "acosh (7) == 2.63391579384963341725009269461593689": -ildouble: 1 -ldouble: 1 - -# asinh -Test "asinh (0.75) == 0.693147180559945309417232121458176568": -ildouble: 1 -ldouble: 1 - -# atan2 -Test "atan2 (0.390625, .00029) == 1.57005392693128974780151246612928941": -ildouble: 1 -ldouble: 1 -Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": -ildouble: 1 -ldouble: 1 - -# atanh -Test "atanh (0.75) == 0.972955074527656652552676371721589865": -ildouble: 1 -ldouble: 1 - -# cacos -Test "Real part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i": -float: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -# cacosh -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 -ildouble: 6 -ldouble: 6 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -idouble: 1 -ildouble: 2 -ldouble: 2 -Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i": -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i": -float: 1 -ifloat: 1 - -# casin -Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -ildouble: 3 -ldouble: 3 -Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": -float: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -# casinh -Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 6 -float: 19 -idouble: 6 -ifloat: 19 -ildouble: 5 -ldouble: 5 -Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 13 -float: 1 -idouble: 13 -ifloat: 1 -ildouble: 6 -ldouble: 6 -Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# catan -Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i": -ildouble: 1 -ldouble: 1 - -# catanh -Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -ildouble: 1 -ldouble: 1 - -# cbrt -Test "cbrt (-0.001) == -0.1": -ildouble: 1 -ldouble: 1 -Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217": -ildouble: 1 -ldouble: 1 - -# ccos -Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": -float: 1 -ifloat: 1 -Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# ccosh -Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# cexp -Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": -float: 1 -ifloat: 1 -Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -float: 2 -ifloat: 2 -Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# clog -Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -ildouble: 1 -ldouble: 1 - -# clog10 -Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i": -double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -double: 1 -idouble: 1 -ildouble: 2 -ldouble: 2 -Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": -float: 1 -ifloat: 1 - -# cos -Test "cos (M_PI_6l * 2.0) == 0.5": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "cos (M_PI_6l * 4.0) == -0.5": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "cos (pi/2) == 0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# cpow -Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": -float: 1 -ifloat: 1 -ildouble: 9 -ldouble: 9 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i": -float: 2 -ifloat: 2 -ildouble: 2 -ldouble: 2 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 15 -ldouble: 15 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i": -ildouble: 5 -ldouble: 5 -Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 4 -ldouble: 4 -Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -float: 6 -ifloat: 6 -ildouble: 2 -ldouble: 2 -Test "Real part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -double: 2 -float: 3 -idouble: 2 -ifloat: 3 -ildouble: 1 -ldouble: 1 - -# csin -Test "Real part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i": -float: 1 -ifloat: 1 -Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i": -float: 1 -ifloat: 1 - -# csinh -Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": -float: 1 -ifloat: 1 -Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 - -# ctan -Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": -double: 1 -idouble: 1 -ildouble: 1 -ldouble: 1 -Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -ildouble: 2 -ldouble: 2 - -# ctanh -Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": -ildouble: 1 -ldouble: 1 -Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": -double: 1 -idouble: 1 -Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# erfc -Test "erfc (0.75) == 0.288844366346484868401062165408589223": -float: 1 -ifloat: 1 -Test "erfc (1.25) == 0.0770998717435417698634765188027188596": -ildouble: 1 -ldouble: 1 -Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": -float: 1 -ifloat: 1 - -# expm1 -Test "expm1 (1) == M_El - 1.0": -ildouble: 1 -ldouble: 1 - -# gamma -Test "gamma (-0.5) == log(2*sqrt(pi))": -ildouble: 1 -ldouble: 1 -Test "gamma (0.5) == log(sqrt(pi))": -ildouble: 1 -ldouble: 1 -Test "gamma (3) == M_LN2l": -ildouble: 1 -ldouble: 1 - -# hypot -Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 - -# j0 -Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "j0 (0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "j0 (1.5) == 0.511827671735918128749051744283411720": -float: 1 -ifloat: 1 -Test "j0 (10.0) == -0.245935764451348335197760862485328754": -double: 1 -idouble: 1 -Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# j1 -Test "j1 (-1.0) == -0.440050585744933515959682203718914913": -float: 1 -ifloat: 1 -Test "j1 (1.0) == 0.440050585744933515959682203718914913": -float: 1 -ifloat: 1 -Test "j1 (1.5) == 0.557936507910099641990121213156089400": -float: 1 -ifloat: 1 -Test "j1 (10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "j1 (2.0) == 0.576724807756873387202448242269137087": -float: 1 -ifloat: 1 -Test "j1 (8.0) == 0.234636346853914624381276651590454612": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# jn -Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "jn (0, 1.5) == 0.511827671735918128749051744283411720": -float: 1 -ifloat: 1 -Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": -double: 1 -idouble: 1 -Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (1, -1.0) == -0.440050585744933515959682203718914913": -float: 1 -ifloat: 1 -Test "jn (1, 1.0) == 0.440050585744933515959682203718914913": -float: 1 -ifloat: 1 -Test "jn (1, 1.5) == 0.557936507910099641990121213156089400": -float: 1 -ifloat: 1 -Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": -float: 1 -ifloat: 1 -Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (10, -1.0) == 0.263061512368745320699785368779050294e-9": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": -float: 1 -ifloat: 1 -Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": -float: 2 -ifloat: 2 -ildouble: 2 -ldouble: 2 -Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -ildouble: 2 -ldouble: 2 -Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": -ildouble: 1 -ldouble: 1 - -# lgamma -Test "lgamma (-0.5) == log(2*sqrt(pi))": -ildouble: 1 -ldouble: 1 -Test "lgamma (0.5) == log(sqrt(pi))": -ildouble: 1 -ldouble: 1 -Test "lgamma (0.7) == 0.260867246531666514385732417016759578": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "lgamma (3) == M_LN2l": -ildouble: 1 -ldouble: 1 - -# log -Test "log (0.75) == -0.287682072451780927439219005993827432": -ildouble: 1 -ldouble: 1 -Test "log (2) == M_LN2l": -ildouble: 1 -ldouble: 1 -Test "log (e) == 1": -float: 1 -ifloat: 1 - -# log10 -Test "log10 (0.75) == -0.124938736608299953132449886193870744": -ildouble: 2 -ldouble: 2 -Test "log10 (e) == log10(e)": -float: 1 -ifloat: 1 - -# log1p -Test "log1p (-0.25) == -0.287682072451780927439219005993827432": -ildouble: 1 -ldouble: 1 - -# log2 -Test "log2 (0.75) == -.415037499278843818546261056052183492": -ildouble: 1 -ldouble: 1 - -# pow -Test "pow (0.75, 1.25) == 0.697953644326574699205914060237425566": -ildouble: 1 -ldouble: 1 - -# sincos -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# sinh -Test "sinh (0.75) == 0.822316731935829980703661634446913849": -ildouble: 1 -ldouble: 1 - -# tan -Test "tan (0.75) == 0.931596459944072461165202756573936428": -ildouble: 1 -ldouble: 1 -Test "tan (pi/4) == 1": -double: 1 -idouble: 1 - -# tgamma -Test "tgamma (-0.5) == -2 sqrt (pi)": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "tgamma (0.5) == sqrt (pi)": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "tgamma (4) == 6": -ildouble: 1 -ldouble: 1 - -# y0 -Test "y0 (0.125) == -1.38968062514384052915582277745018693": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "y0 (0.75) == -0.137172769385772397522814379396581855": -double: 1 -idouble: 1 -ildouble: 2 -ldouble: 2 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628": -ildouble: 1 -ldouble: 1 -Test "y0 (1.5) == 0.382448923797758843955068554978089862": -ildouble: 1 -ldouble: 1 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481": -ildouble: 1 -ldouble: 1 -Test "y0 (2.0) == 0.510375672649745119596606592727157873": -float: 1 -ifloat: 1 -Test "y0 (8.0) == 0.223521489387566220527323400498620359": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -# y1 -Test "y1 (0.125) == -5.19993611253477499595928744876579921": -ildouble: 1 -ldouble: 1 -Test "y1 (1.0) == -0.781212821300288716547150000047964821": -double: 1 -idouble: 1 -Test "y1 (10.0) == 0.249015424206953883923283474663222803": -float: 1 -ifloat: 1 -Test "y1 (2.0) == -0.107032431540937546888370772277476637": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "y1 (8.0) == -0.158060461731247494255555266187483550": -ildouble: 1 -ldouble: 1 - -# yn -Test "yn (0, 0.125) == -1.38968062514384052915582277745018693": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "yn (0, 0.75) == -0.137172769385772397522814379396581855": -double: 1 -idouble: 1 -ildouble: 2 -ldouble: 2 -Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": -ildouble: 1 -ldouble: 1 -Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": -ildouble: 1 -ldouble: 1 -Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": -ildouble: 1 -ldouble: 1 -Test "yn (0, 2.0) == 0.510375672649745119596606592727157873": -float: 1 -ifloat: 1 -Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 -Test "yn (1, 0.75) == -1.03759455076928541973767132140642198": -float: 1 -ifloat: 1 -Test "yn (1, 1.0) == -0.781212821300288716547150000047964821": -double: 1 -idouble: 1 -Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": -float: 1 -ifloat: 1 -Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 -Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": -ildouble: 1 -ldouble: 1 -Test "yn (10, 0.125) == -127057845771019398.252538486899753195": -double: 1 -idouble: 1 -ildouble: 2 -ldouble: 2 -Test "yn (10, 0.75) == -2133501638.90573424452445412893839236": -float: 1 -ifloat: 1 -ildouble: 4 -ldouble: 4 -Test "yn (10, 10.0) == -0.359814152183402722051986577343560609": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": -ildouble: 1 -ldouble: 1 -Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 -Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": -float: 1 -ifloat: 1 - -# Maximal error of functions: -Function: "acosh": -ildouble: 1 -ldouble: 1 - -Function: "asinh": -ildouble: 1 -ldouble: 1 - -Function: "atan2": -ildouble: 1 -ldouble: 1 - -Function: "atanh": -ildouble: 1 -ldouble: 1 - -Function: Real part of "cacos": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "cacos": -float: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: Real part of "cacosh": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 -ildouble: 6 -ldouble: 6 - -Function: Imaginary part of "cacosh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: Real part of "casin": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -ildouble: 3 -ldouble: 3 - -Function: Imaginary part of "casin": -float: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: Real part of "casinh": -double: 6 -float: 19 -idouble: 6 -ifloat: 19 -ildouble: 5 -ldouble: 5 - -Function: Imaginary part of "casinh": -double: 13 -float: 1 -idouble: 13 -ifloat: 1 -ildouble: 6 -ldouble: 6 - -Function: Real part of "catan": -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "catan": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "catanh": -ildouble: 1 -ldouble: 1 - -Function: "cbrt": -ildouble: 1 -ldouble: 1 - -Function: Real part of "ccos": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "ccos": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Real part of "ccosh": -float: 1 -ifloat: 1 - -Function: Imaginary part of "ccosh": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Real part of "cexp": -float: 2 -ifloat: 2 - -Function: Imaginary part of "cexp": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Real part of "clog": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "clog": -ildouble: 1 -ldouble: 1 - -Function: Real part of "clog10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "clog10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: "cos": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Real part of "cpow": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 15 -ldouble: 15 - -Function: Imaginary part of "cpow": -double: 2 -float: 6 -idouble: 2 -ifloat: 6 -ildouble: 2 -ldouble: 2 - -Function: Real part of "csin": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "csin": -float: 1 -ifloat: 1 - -Function: Real part of "csinh": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "csinh": -float: 1 -ifloat: 1 - -Function: Real part of "ctan": -double: 1 -idouble: 1 -ildouble: 1 -ldouble: 1 - -Function: Imaginary part of "ctan": -ildouble: 2 -ldouble: 2 - -Function: Imaginary part of "ctanh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "erfc": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "expm1": -ildouble: 1 -ldouble: 1 - -Function: "gamma": -ildouble: 1 -ldouble: 1 - -Function: "hypot": -float: 1 -ifloat: 1 - -Function: "j0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "j1": -float: 2 -ifloat: 2 -ildouble: 1 -ldouble: 1 - -Function: "jn": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -ildouble: 2 -ldouble: 2 - -Function: "lgamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 1 -ldouble: 1 - -Function: "log": -float: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "log10": -float: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: "log1p": -ildouble: 1 -ldouble: 1 - -Function: "log2": -ildouble: 1 -ldouble: 1 - -Function: "pow": -ildouble: 1 -ldouble: 1 - -Function: "sincos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "sinh": -ildouble: 1 -ldouble: 1 - -Function: "tan": -double: 1 -idouble: 1 -ildouble: 1 -ldouble: 1 - -Function: "tgamma": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 1 -ldouble: 1 - -Function: "y0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -ildouble: 2 -ldouble: 2 - -Function: "y1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 1 -ldouble: 1 - -Function: "yn": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -ildouble: 4 -ldouble: 4 - -# end of automatic generation diff --git a/sysdeps/m68k/fpu/mathimpl.h b/sysdeps/m68k/fpu/mathimpl.h deleted file mode 100644 index bbcaf84859..0000000000 --- a/sysdeps/m68k/fpu/mathimpl.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Definitions of libc internal inline math functions implemented - by the m68881/2. - Copyright (C) 1991,92,93,94,96,97,98,99 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 the definitions of the inline math functions that - are only used internally inside libm, not visible to the user. */ - -__inline_mathop (__ieee754_acos, acos) -__inline_mathop (__ieee754_asin, asin) -__inline_mathop (__ieee754_cosh, cosh) -__inline_mathop (__ieee754_sinh, sinh) -__inline_mathop (__ieee754_exp, etox) -__inline_mathop (__ieee754_exp2, twotox) -__inline_mathop (__ieee754_exp10, tentox) -__inline_mathop (__ieee754_log10, log10) -__inline_mathop (__ieee754_log2, log2) -__inline_mathop (__ieee754_log, logn) -__inline_mathop (__ieee754_sqrt, sqrt) -__inline_mathop (__ieee754_atanh, atanh) - -__m81_defun (double, __ieee754_remainder, (double __x, double __y)) -{ - double __result; - __asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -__m81_defun (float, __ieee754_remainderf, (float __x, float __y)) -{ - float __result; - __asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -__m81_defun (long double, - __ieee754_remainderl, (long double __x, long double __y)) -{ - long double __result; - __asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -__m81_defun (double, __ieee754_fmod, (double __x, double __y)) -{ - double __result; - __asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -__m81_defun (float, __ieee754_fmodf, (float __x, float __y)) -{ - float __result; - __asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -__m81_defun (long double, - __ieee754_fmodl, (long double __x, long double __y)) -{ - long double __result; - __asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); - return __result; -} - -/* Get the m68881 condition codes, to quickly check multiple conditions. */ -static __inline__ unsigned long -__m81_test (long double __val) -{ - unsigned long __fpsr; - __asm ("ftst%.x %1; fmove%.l %/fpsr,%0" : "=dm" (__fpsr) : "f" (__val)); - return __fpsr; -} - -/* Bit values returned by __m81_test. */ -#define __M81_COND_NAN (1 << 24) -#define __M81_COND_INF (2 << 24) -#define __M81_COND_ZERO (4 << 24) -#define __M81_COND_NEG (8 << 24) diff --git a/sysdeps/m68k/fpu/mpa.c b/sysdeps/m68k/fpu/mpa.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mpa.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mpatan.c b/sysdeps/m68k/fpu/mpatan.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mpatan.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mpatan2.c b/sysdeps/m68k/fpu/mpatan2.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mpatan2.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mpexp.c b/sysdeps/m68k/fpu/mpexp.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mpexp.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mplog.c b/sysdeps/m68k/fpu/mplog.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mplog.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mpsqrt.c b/sysdeps/m68k/fpu/mpsqrt.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mpsqrt.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/mptan.c b/sysdeps/m68k/fpu/mptan.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/mptan.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/s_atan.c b/sysdeps/m68k/fpu/s_atan.c deleted file mode 100644 index 8cca490d2a..0000000000 --- a/sysdeps/m68k/fpu/s_atan.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1996, 1997 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 <math.h> - -#ifndef FUNC -#define FUNC atan -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__,FUNC) (x) - float_type x; -{ - return __m81_u(__CONCATX(__,FUNC))(x); -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (__CONCATX(__,FUNC), FUNC) diff --git a/sysdeps/m68k/fpu/s_atanf.c b/sysdeps/m68k/fpu/s_atanf.c deleted file mode 100644 index c98559a8ba..0000000000 --- a/sysdeps/m68k/fpu/s_atanf.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC atanf -#endif -#define float_type float -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_atanl.c b/sysdeps/m68k/fpu/s_atanl.c deleted file mode 100644 index b7e608addd..0000000000 --- a/sysdeps/m68k/fpu/s_atanl.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC atanl -#endif -#define float_type long double -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_ccos.c b/sysdeps/m68k/fpu/s_ccos.c deleted file mode 100644 index d302d3d86b..0000000000 --- a/sysdeps/m68k/fpu/s_ccos.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Complex cosine function. m68k fpu version - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__ccos) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long rx_cond = __m81_test (__real__ x); - - if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) - { - /* Real part is finite. */ - float_type sin_rx, cos_rx; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx) - : "f" (__real__ x)); - __real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x); - if (rx_cond & __M81_COND_ZERO) - __imag__ retval = (m81(__signbit) (__imag__ x) - ? __real__ x : -__real__ x); - else - __imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x); - } - else - { - unsigned long ix_cond = __m81_test (__imag__ x); - - if (ix_cond & __M81_COND_INF) - __real__ retval = s(fabs) (__imag__ x); - else - __real__ retval = __real__ x - __real__ x; - if (ix_cond & __M81_COND_ZERO) - __imag__ retval = __imag__ x; - else - __imag__ retval = __real__ x - __real__ x; - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__ccos), s(ccos)) diff --git a/sysdeps/m68k/fpu/s_ccosf.c b/sysdeps/m68k/fpu/s_ccosf.c deleted file mode 100644 index f5e8a41faf..0000000000 --- a/sysdeps/m68k/fpu/s_ccosf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_ccos.c> diff --git a/sysdeps/m68k/fpu/s_ccosh.c b/sysdeps/m68k/fpu/s_ccosh.c deleted file mode 100644 index 1698881b9f..0000000000 --- a/sysdeps/m68k/fpu/s_ccosh.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Complex cosine hyperbole function. m68k fpu version - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__ccosh) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long ix_cond = __m81_test (__imag__ x); - - if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) - { - /* Imaginary part is finite. */ - float_type sin_ix, cos_ix; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - __real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x); - if (ix_cond & __M81_COND_ZERO) - __imag__ retval = (m81(__signbit) (__real__ x) - ? -__imag__ x : __imag__ x); - else - __imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x); - } - else - { - unsigned long rx_cond = __m81_test (__real__ x); - - if (rx_cond & __M81_COND_ZERO) - { - __real__ retval = __imag__ x - __imag__ x; - __imag__ retval = __real__ x; - } - else - { - if (rx_cond & __M81_COND_INF) - __real__ retval = s(fabs) (__real__ x); - else - __real__ retval = 0.0/0.0; - __imag__ retval = __imag__ x - __imag__ x; - } - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__ccosh), s(ccosh)) diff --git a/sysdeps/m68k/fpu/s_ccoshf.c b/sysdeps/m68k/fpu/s_ccoshf.c deleted file mode 100644 index 3c8e7c7bb7..0000000000 --- a/sysdeps/m68k/fpu/s_ccoshf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_ccosh.c> diff --git a/sysdeps/m68k/fpu/s_ccoshl.c b/sysdeps/m68k/fpu/s_ccoshl.c deleted file mode 100644 index 772d5786cf..0000000000 --- a/sysdeps/m68k/fpu/s_ccoshl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_ccosh.c> diff --git a/sysdeps/m68k/fpu/s_ccosl.c b/sysdeps/m68k/fpu/s_ccosl.c deleted file mode 100644 index aaff365208..0000000000 --- a/sysdeps/m68k/fpu/s_ccosl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_ccos.c> diff --git a/sysdeps/m68k/fpu/s_ceil.c b/sysdeps/m68k/fpu/s_ceil.c deleted file mode 100644 index 93d5ad72e5..0000000000 --- a/sysdeps/m68k/fpu/s_ceil.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC ceil -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_ceilf.c b/sysdeps/m68k/fpu/s_ceilf.c deleted file mode 100644 index b3ba6a5700..0000000000 --- a/sysdeps/m68k/fpu/s_ceilf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC ceilf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_ceill.c b/sysdeps/m68k/fpu/s_ceill.c deleted file mode 100644 index 2bf95b00c6..0000000000 --- a/sysdeps/m68k/fpu/s_ceill.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC ceill -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_cexp.c b/sysdeps/m68k/fpu/s_cexp.c deleted file mode 100644 index 4babf12685..0000000000 --- a/sysdeps/m68k/fpu/s_cexp.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Complex exponential function. m68k fpu version - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__cexp) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long ix_cond; - - ix_cond = __m81_test (__imag__ x); - - if ((ix_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0) - { - /* Imaginary part is finite. */ - float_type exp_val = m81(__ieee754_exp) (__real__ x); - - __real__ retval = __imag__ retval = exp_val; - if (m81(__finite) (exp_val)) - { - float_type sin_ix, cos_ix; - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - __real__ retval *= cos_ix; - if (ix_cond & __M81_COND_ZERO) - __imag__ retval = __imag__ x; - else - __imag__ retval *= sin_ix; - } - else - { - /* Compute the sign of the result. */ - float_type remainder, pi_2; - int quadrant; - - __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2)); - __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1" - : "=f" (remainder), "=dm" (quadrant) - : "f" (pi_2), "0" (__imag__ x)); - quadrant = (quadrant >> 16) & 0x83; - if (quadrant & 0x80) - quadrant ^= 0x83; - switch (quadrant) - { - default: - break; - case 1: - __real__ retval = -__real__ retval; - break; - case 2: - __real__ retval = -__real__ retval; - case 3: - __imag__ retval = -__imag__ retval; - break; - } - if (ix_cond & __M81_COND_ZERO && !m81(__isnan) (exp_val)) - __imag__ retval = __imag__ x; - } - } - else - { - unsigned long rx_cond = __m81_test (__real__ x); - - if (rx_cond & __M81_COND_INF) - { - /* Real part is infinite. */ - if (rx_cond & __M81_COND_NEG) - { - __real__ retval = __imag__ retval = 0.0; - if (ix_cond & __M81_COND_NEG) - __imag__ retval = -__imag__ retval; - } - else - { - __real__ retval = __real__ x; - __imag__ retval = __imag__ x - __imag__ x; - } - } - else - __real__ retval = __imag__ retval = __imag__ x - __imag__ x; - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__cexp), s(cexp)) diff --git a/sysdeps/m68k/fpu/s_cexpf.c b/sysdeps/m68k/fpu/s_cexpf.c deleted file mode 100644 index 177a360f9b..0000000000 --- a/sysdeps/m68k/fpu/s_cexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_cexp.c> diff --git a/sysdeps/m68k/fpu/s_cexpl.c b/sysdeps/m68k/fpu/s_cexpl.c deleted file mode 100644 index bbda4ba990..0000000000 --- a/sysdeps/m68k/fpu/s_cexpl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_cexp.c> diff --git a/sysdeps/m68k/fpu/s_cos.c b/sysdeps/m68k/fpu/s_cos.c deleted file mode 100644 index 9c96076316..0000000000 --- a/sysdeps/m68k/fpu/s_cos.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC cos -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_cosf.c b/sysdeps/m68k/fpu/s_cosf.c deleted file mode 100644 index db965b8cc1..0000000000 --- a/sysdeps/m68k/fpu/s_cosf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC cosf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_cosl.c b/sysdeps/m68k/fpu/s_cosl.c deleted file mode 100644 index 4198feef18..0000000000 --- a/sysdeps/m68k/fpu/s_cosl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC cosl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_csin.c b/sysdeps/m68k/fpu/s_csin.c deleted file mode 100644 index 7c590e4af6..0000000000 --- a/sysdeps/m68k/fpu/s_csin.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Complex sine function. m68k fpu version - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__csin) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long rx_cond = __m81_test (__real__ x); - - if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) - { - /* Real part is finite. */ - float_type sin_rx, cos_rx; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx) - : "f" (__real__ x)); - if (rx_cond & __M81_COND_ZERO) - __real__ retval = __real__ x; - else - __real__ retval = sin_rx * m81(__ieee754_cosh) (__imag__ x); - __imag__ retval = cos_rx * m81(__ieee754_sinh) (__imag__ x); - } - else - { - unsigned long ix_cond = __m81_test (__imag__ x); - - __real__ retval = __real__ x - __real__ x; - if (ix_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN)) - __imag__ retval = __imag__ x; - else - __imag__ retval = __real__ retval; - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__csin), s(csin)) diff --git a/sysdeps/m68k/fpu/s_csinf.c b/sysdeps/m68k/fpu/s_csinf.c deleted file mode 100644 index b760e192c3..0000000000 --- a/sysdeps/m68k/fpu/s_csinf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_csin.c> diff --git a/sysdeps/m68k/fpu/s_csinh.c b/sysdeps/m68k/fpu/s_csinh.c deleted file mode 100644 index dafb82af1a..0000000000 --- a/sysdeps/m68k/fpu/s_csinh.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Complex sine hyperbole function. m68k fpu version - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__csinh) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long ix_cond; - - ix_cond = __m81_test (__imag__ x); - - if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) - { - /* Imaginary part is finite. */ - float_type sin_ix, cos_ix; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - __real__ retval = cos_ix * m81(__ieee754_sinh) (__real__ x); - if (ix_cond & __M81_COND_ZERO) - __imag__ retval = __imag__ x; - else - __imag__ retval = sin_ix * m81(__ieee754_cosh) (__real__ x); - } - else - { - unsigned long rx_cond = __m81_test (__real__ x); - - __imag__ retval = __imag__ x - __imag__ x; - if (rx_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN)) - __real__ retval = __real__ x; - else - __real__ retval = __imag__ retval; - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__csinh), s(csinh)) diff --git a/sysdeps/m68k/fpu/s_csinhf.c b/sysdeps/m68k/fpu/s_csinhf.c deleted file mode 100644 index 2f7a43e6a8..0000000000 --- a/sysdeps/m68k/fpu/s_csinhf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_csinh.c> diff --git a/sysdeps/m68k/fpu/s_csinhl.c b/sysdeps/m68k/fpu/s_csinhl.c deleted file mode 100644 index 026a20e7be..0000000000 --- a/sysdeps/m68k/fpu/s_csinhl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_csinh.c> diff --git a/sysdeps/m68k/fpu/s_csinl.c b/sysdeps/m68k/fpu/s_csinl.c deleted file mode 100644 index ea2dad0556..0000000000 --- a/sysdeps/m68k/fpu/s_csinl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_csin.c> diff --git a/sysdeps/m68k/fpu/s_expm1.c b/sysdeps/m68k/fpu/s_expm1.c deleted file mode 100644 index 1ef99e21c9..0000000000 --- a/sysdeps/m68k/fpu/s_expm1.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC expm1 -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_expm1f.c b/sysdeps/m68k/fpu/s_expm1f.c deleted file mode 100644 index 84935b1b4a..0000000000 --- a/sysdeps/m68k/fpu/s_expm1f.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC expm1f -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_expm1l.c b/sysdeps/m68k/fpu/s_expm1l.c deleted file mode 100644 index feee07a1d8..0000000000 --- a/sysdeps/m68k/fpu/s_expm1l.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC expm1l -#include <s_atanl.c> -libm_hidden_def (__expm1l) diff --git a/sysdeps/m68k/fpu/s_fabs.c b/sysdeps/m68k/fpu/s_fabs.c deleted file mode 100644 index 1f0631e2ff..0000000000 --- a/sysdeps/m68k/fpu/s_fabs.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC fabs -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_fabsf.c b/sysdeps/m68k/fpu/s_fabsf.c deleted file mode 100644 index 8f9421998a..0000000000 --- a/sysdeps/m68k/fpu/s_fabsf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC fabsf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_fabsl.c b/sysdeps/m68k/fpu/s_fabsl.c deleted file mode 100644 index 8ac14d5b8c..0000000000 --- a/sysdeps/m68k/fpu/s_fabsl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC fabsl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_finite.c b/sysdeps/m68k/fpu/s_finite.c deleted file mode 100644 index dafbd5901d..0000000000 --- a/sysdeps/m68k/fpu/s_finite.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC finite -#include <s_isinf.c> diff --git a/sysdeps/m68k/fpu/s_finitef.c b/sysdeps/m68k/fpu/s_finitef.c deleted file mode 100644 index b81342e5c6..0000000000 --- a/sysdeps/m68k/fpu/s_finitef.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC finitef -#include <s_isinff.c> diff --git a/sysdeps/m68k/fpu/s_finitel.c b/sysdeps/m68k/fpu/s_finitel.c deleted file mode 100644 index bd346a220c..0000000000 --- a/sysdeps/m68k/fpu/s_finitel.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC finitel -#include <s_isinfl.c> diff --git a/sysdeps/m68k/fpu/s_floor.c b/sysdeps/m68k/fpu/s_floor.c deleted file mode 100644 index e1219c602a..0000000000 --- a/sysdeps/m68k/fpu/s_floor.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC floor -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_floorf.c b/sysdeps/m68k/fpu/s_floorf.c deleted file mode 100644 index f4f9b9a1d8..0000000000 --- a/sysdeps/m68k/fpu/s_floorf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC floorf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_floorl.c b/sysdeps/m68k/fpu/s_floorl.c deleted file mode 100644 index 2c1ffd7d2c..0000000000 --- a/sysdeps/m68k/fpu/s_floorl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC floorl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_fpclassifyl.c b/sysdeps/m68k/fpu/s_fpclassifyl.c deleted file mode 100644 index a8cb099927..0000000000 --- a/sysdeps/m68k/fpu/s_fpclassifyl.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Return classification value corresponding to argument. m68k version. - Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - Fixed for m68k by Andreas Schwab <schwab@suse.de>. - - 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 <math.h> - -#include "math_private.h" - - -int -__fpclassifyl (long double x) -{ - u_int32_t ex, hx, lx; - int retval = FP_NORMAL; - - GET_LDOUBLE_WORDS (ex, hx, lx, x); - ex &= 0x7fff; - if ((ex | hx | lx) == 0) - retval = FP_ZERO; - else if (ex == 0 && (hx & 0x80000000) == 0) - retval = FP_SUBNORMAL; - else if (ex == 0x7fff) - retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE; - - return retval; -} -libm_hidden_def (__fpclassifyl) diff --git a/sysdeps/m68k/fpu/s_frexp.c b/sysdeps/m68k/fpu/s_frexp.c deleted file mode 100644 index b06141283c..0000000000 --- a/sysdeps/m68k/fpu/s_frexp.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 1996, 1997, 2003 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 <math.h> - -#ifndef FUNC -#define FUNC frexp -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__,FUNC) (float_type value, int *expptr) -{ - float_type mantissa, exponent; - int iexponent; - unsigned long fpsr; - - __asm ("ftst%.x %1\n" - "fmove%.l %/fpsr, %0" - : "=dm" (fpsr) : "f" (value)); - if (fpsr & (7 << 24)) - { - /* Not finite or zero. */ - *expptr = 0; - return value; - } - __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value)); - iexponent = (int) exponent + 1; - *expptr = iexponent; - __asm ("fscale%.l %2, %0" - : "=f" (mantissa) - : "0" (value), "dmi" (-iexponent)); - return mantissa; -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (__CONCATX(__,FUNC), FUNC) diff --git a/sysdeps/m68k/fpu/s_frexpf.c b/sysdeps/m68k/fpu/s_frexpf.c deleted file mode 100644 index 893b6ad3cf..0000000000 --- a/sysdeps/m68k/fpu/s_frexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC frexpf -#define float_type float -#include <s_frexp.c> diff --git a/sysdeps/m68k/fpu/s_frexpl.c b/sysdeps/m68k/fpu/s_frexpl.c deleted file mode 100644 index f9a5315265..0000000000 --- a/sysdeps/m68k/fpu/s_frexpl.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (C) 2003 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 <math.h> - -long double -__frexpl (long double value, int *expptr) -{ - long double mantissa, exponent; - int iexponent; - unsigned long fpsr; - - __asm ("ftst%.x %1\n" - "fmove%.l %/fpsr, %0" - : "=dm" (fpsr) : "f" (value)); - if (fpsr & (7 << 24)) - { - /* Not finite or zero. */ - *expptr = 0; - return value; - } - __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value)); - iexponent = (int) exponent + 1; - *expptr = iexponent; - /* Unnormalized numbers must be handled specially, otherwise fscale - results in overflow. */ - if (iexponent <= -16384) - { - value *= 0x1p16383L; - iexponent += 16383; - } - else if (iexponent >= 16384) - { - value *= 0x1p-16383L; - iexponent -= 16383; - } - - __asm ("fscale%.l %2, %0" - : "=f" (mantissa) - : "0" (value), "dmi" (-iexponent)); - return mantissa; -} - -weak_alias (__frexpl, frexpl) diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c deleted file mode 100644 index ee1e3975f0..0000000000 --- a/sysdeps/m68k/fpu/s_ilogb.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -int -s(__ilogb) (float_type x) -{ - float_type result; - unsigned long x_cond; - - x_cond = __m81_test (x); - /* We must return consistent values for zero and NaN. */ - if (x_cond & __M81_COND_ZERO) - return FP_ILOGB0; - if (x_cond & (__M81_COND_NAN | __M81_COND_INF)) - return FP_ILOGBNAN; - - __asm ("fgetexp%.x %1, %0" : "=f" (result) : "f" (x)); - return (int) result; -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__ilogb), s(ilogb)) diff --git a/sysdeps/m68k/fpu/s_ilogbf.c b/sysdeps/m68k/fpu/s_ilogbf.c deleted file mode 100644 index 4031c42ff7..0000000000 --- a/sysdeps/m68k/fpu/s_ilogbf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_ilogb.c> diff --git a/sysdeps/m68k/fpu/s_ilogbl.c b/sysdeps/m68k/fpu/s_ilogbl.c deleted file mode 100644 index 9c55a115e0..0000000000 --- a/sysdeps/m68k/fpu/s_ilogbl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_ilogb.c> diff --git a/sysdeps/m68k/fpu/s_isinf.c b/sysdeps/m68k/fpu/s_isinf.c deleted file mode 100644 index 5fb43ea2a0..0000000000 --- a/sysdeps/m68k/fpu/s_isinf.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1996, 1997, 2002 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 <math.h> - -#ifndef FUNC -#define FUNC isinf -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -int -__CONCATX(__,FUNC) (x) - float_type x; -{ - return __m81_u(__CONCATX(__,FUNC))(x); -} - -#define hidden_defx(a) hidden_def(a) -hidden_defx(__CONCATX(__,FUNC)) -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (__CONCATX(__,FUNC), FUNC) diff --git a/sysdeps/m68k/fpu/s_isinff.c b/sysdeps/m68k/fpu/s_isinff.c deleted file mode 100644 index ebf4f2ae96..0000000000 --- a/sysdeps/m68k/fpu/s_isinff.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC isinff -#endif -#define float_type float -#include <s_isinf.c> diff --git a/sysdeps/m68k/fpu/s_isinfl.c b/sysdeps/m68k/fpu/s_isinfl.c deleted file mode 100644 index 963725ad77..0000000000 --- a/sysdeps/m68k/fpu/s_isinfl.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef FUNC -#define FUNC isinfl -#endif -#define float_type long double -#include <s_isinf.c> diff --git a/sysdeps/m68k/fpu/s_isnan.c b/sysdeps/m68k/fpu/s_isnan.c deleted file mode 100644 index 151d6dc6b4..0000000000 --- a/sysdeps/m68k/fpu/s_isnan.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC isnan -#include <s_isinf.c> diff --git a/sysdeps/m68k/fpu/s_isnanf.c b/sysdeps/m68k/fpu/s_isnanf.c deleted file mode 100644 index 667bca7235..0000000000 --- a/sysdeps/m68k/fpu/s_isnanf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC isnanf -#include <s_isinff.c> diff --git a/sysdeps/m68k/fpu/s_isnanl.c b/sysdeps/m68k/fpu/s_isnanl.c deleted file mode 100644 index bbacb64f11..0000000000 --- a/sysdeps/m68k/fpu/s_isnanl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC isnanl -#include <s_isinfl.c> diff --git a/sysdeps/m68k/fpu/s_llrint.c b/sysdeps/m68k/fpu/s_llrint.c deleted file mode 100644 index 8f2442982a..0000000000 --- a/sysdeps/m68k/fpu/s_llrint.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Round argument to nearest integral value according to current rounding - direction. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <math.h> -#include "math_private.h" -#include "mathimpl.h" - -long long int -__llrint (double x) -{ - int32_t e; - u_int32_t h, l, s; - long long int result; - - x = __m81_u(__rint) (x); - - /* We could use __fixxfdi from libgcc, but here we can take advantage of - the known floating point format. */ - EXTRACT_WORDS (h, l, x); - - e = ((h >> 20) & 0x7ff) - 0x3ff; - if (e < 0) - return 0; - s = h; - h &= 0xfffff; - h |= 0x100000; - - if (e < 63) - { - if (e > 52) - { - h <<= e - 52; - h |= l >> (84 - e); - l <<= e - 52; - result = ((long long int) h << 32) | l; - } - else if (e > 20) - { - l >>= 52 - e; - l |= h << (e - 20); - h >>= 52 - e; - result = ((long long int) h << 32) | l; - } - else - result = h >> (20 - e); - if (s & 0x80000000) - result = -result; - } - else - /* The number is too large or not finite. The standard leaves it - undefined what to return when the number is too large to fit in a - `long long int'. */ - result = -1LL; - - return result; -} - -weak_alias (__llrint, llrint) diff --git a/sysdeps/m68k/fpu/s_llrintf.c b/sysdeps/m68k/fpu/s_llrintf.c deleted file mode 100644 index bd573b2579..0000000000 --- a/sysdeps/m68k/fpu/s_llrintf.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Round argument to nearest integral value according to current rounding - direction. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <math.h> -#include "math_private.h" -#include "mathimpl.h" - -long long int -__llrintf (float x) -{ - int32_t e; - u_int32_t i, s; - long long int result; - - x = __m81_u(__rintf) (x); - - GET_FLOAT_WORD (i, x); - - e = ((i >> 23) & 0xff) - 0x7f; - if (e < 0) - return 0; - s = i; - i &= 0x7fffff; - i |= 0x800000; - - if (e < 63) - { - if (e > 55) - result = (long long int) (i << (e - 55)) << 32; - else if (e > 31) - result = (((long long int) (i >> (55 - e)) << 32) | (i << (e - 23))); - else if (e > 23) - result = i << (e - 23); - else - result = i >> (23 - e); - if (s & 0x80000000) - result = -result; - } - else - /* The number is too large or not finite. The standard leaves it - undefined what to return when the number is too large to fit in a - `long long int'. */ - result = -1LL; - - return result; -} - -weak_alias (__llrintf, llrintf) diff --git a/sysdeps/m68k/fpu/s_llrintl.c b/sysdeps/m68k/fpu/s_llrintl.c deleted file mode 100644 index d749f3515f..0000000000 --- a/sysdeps/m68k/fpu/s_llrintl.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Round argument to nearest integral value according to current rounding - direction. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <math.h> -#include "math_private.h" -#include "mathimpl.h" - -long long int -__llrintl (long double x) -{ - int32_t e, s; - u_int32_t h, l; - long long int result; - - x = __m81_u(__rintl) (x); - - GET_LDOUBLE_WORDS (e, h, l, x); - - s = e; - e = (e & 0x7fff) - 0x3fff; - if (e < 0) - return 0; - - if (e < 63) - { - if (e > 31) - { - l >>= 63 - e; - l |= h << (e - 31); - h >>= 63 - e; - result = ((long long int) h << 32) | l; - } - else - result = h >> (31 - e); - if (s & 0x8000) - result = -result; - } - else - /* The number is too large or not finite. The standard leaves it - undefined what to return when the number is too large to fit in a - `long long int'. */ - result = -1LL; - - return result; -} - -weak_alias (__llrintl, llrintl) diff --git a/sysdeps/m68k/fpu/s_log1p.c b/sysdeps/m68k/fpu/s_log1p.c deleted file mode 100644 index 1840ced137..0000000000 --- a/sysdeps/m68k/fpu/s_log1p.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC log1p -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_log1pf.c b/sysdeps/m68k/fpu/s_log1pf.c deleted file mode 100644 index cb7235a071..0000000000 --- a/sysdeps/m68k/fpu/s_log1pf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC log1pf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_log1pl.c b/sysdeps/m68k/fpu/s_log1pl.c deleted file mode 100644 index 8dbef89095..0000000000 --- a/sysdeps/m68k/fpu/s_log1pl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC log1pl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_lrint.c b/sysdeps/m68k/fpu/s_lrint.c deleted file mode 100644 index 0a23f29eeb..0000000000 --- a/sysdeps/m68k/fpu/s_lrint.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Round argument to nearest integral value according to current rounding - direction. - Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <math.h> - -#ifndef suffix -#define suffix /*empty*/ -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) - -long int -CONCATX(__lrint,suffix) (float_type x) -{ - return __m81_u(CONCATX(__lrint,suffix)) (x); -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (CONCATX(__lrint,suffix), CONCATX(lrint,suffix)) diff --git a/sysdeps/m68k/fpu/s_lrintf.c b/sysdeps/m68k/fpu/s_lrintf.c deleted file mode 100644 index 44924cb82f..0000000000 --- a/sysdeps/m68k/fpu/s_lrintf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define suffix f -#define float_type float -#include <s_lrint.c> diff --git a/sysdeps/m68k/fpu/s_lrintl.c b/sysdeps/m68k/fpu/s_lrintl.c deleted file mode 100644 index cd0bd23b8a..0000000000 --- a/sysdeps/m68k/fpu/s_lrintl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define suffix l -#define float_type long double -#include <s_lrint.c> diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c deleted file mode 100644 index 2f5a83dea7..0000000000 --- a/sysdeps/m68k/fpu/s_modf.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 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. */ - -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -float_type -s(__modf) (float_type x, float_type *iptr) -{ - float_type x_int, result; - unsigned long x_cond; - - __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x)); - *iptr = x_int; - x_cond = __m81_test (x); - if (x_cond & __M81_COND_INF) - { - result = 0; - if (x_cond & __M81_COND_NEG) - result = -result; - } - else if (x_cond & __M81_COND_ZERO) - result = x; - else - result = x - x_int; - return result; -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx(s(__modf), s(modf)) diff --git a/sysdeps/m68k/fpu/s_modff.c b/sysdeps/m68k/fpu/s_modff.c deleted file mode 100644 index 0c44d7c0ab..0000000000 --- a/sysdeps/m68k/fpu/s_modff.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_modf.c> diff --git a/sysdeps/m68k/fpu/s_modfl.c b/sysdeps/m68k/fpu/s_modfl.c deleted file mode 100644 index c7075b3ba9..0000000000 --- a/sysdeps/m68k/fpu/s_modfl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_modf.c> diff --git a/sysdeps/m68k/fpu/s_nearbyint.c b/sysdeps/m68k/fpu/s_nearbyint.c deleted file mode 100644 index b87f5e2160..0000000000 --- a/sysdeps/m68k/fpu/s_nearbyint.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC nearbyint -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_nearbyintf.c b/sysdeps/m68k/fpu/s_nearbyintf.c deleted file mode 100644 index 70d08ab44c..0000000000 --- a/sysdeps/m68k/fpu/s_nearbyintf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC nearbyintf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_nearbyintl.c b/sysdeps/m68k/fpu/s_nearbyintl.c deleted file mode 100644 index 230cd7784c..0000000000 --- a/sysdeps/m68k/fpu/s_nearbyintl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC nearbyintl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_nextafterl.c b/sysdeps/m68k/fpu/s_nextafterl.c deleted file mode 100644 index 70ab5a4784..0000000000 --- a/sysdeps/m68k/fpu/s_nextafterl.c +++ /dev/null @@ -1,109 +0,0 @@ -/* s_nextafterl.c -- long double version of s_nextafter.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - * Fixed for m68k by Andreas Schwab <schwab@suse.de>. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* IEEE functions - * nextafterl(x,y) - * return the next machine floating-point number of x in the - * direction toward y. - * Special cases: - */ - -#include "math.h" -#include "math_private.h" - -#ifdef __STDC__ - long double __nextafterl(long double x, long double y) -#else - long double __nextafterl(x,y) - long double x,y; -#endif -{ - int32_t ix,iy,esx,esy; - u_int32_t hx,hy,lx,ly; - - GET_LDOUBLE_WORDS(esx,hx,lx,x); - GET_LDOUBLE_WORDS(esy,hy,ly,y); - ix = esx&0x7fff; /* |x| */ - iy = esy&0x7fff; /* |y| */ - - if(((ix==0x7fff)&&((hx&0x7fffffff)|lx)!=0) || /* x is nan */ - ((iy==0x7fff)&&((hy&0x7fffffff)|ly)!=0)) /* y is nan */ - return x+y; - if(x==y) return y; /* x=y, return y */ - if((ix|hx|lx)==0) { /* x == 0 */ - SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */ - y = x*x; - if(y==x) return y; else return x; /* raise underflow flag */ - } - if(esx>=0) { /* x > 0 */ - if(esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))) { - /* x > y, x -= ulp */ - if(lx==0) { - if (ix != 0 && hx == 0x80000000) hx = 0; - if (hx==0) esx -= 1; - hx -= 1; - } - lx -= 1; - } else { /* x < y, x += ulp */ - lx += 1; - if(lx==0) { - hx += 1; - if (hx==0) { - hx = 0x80000000; - esx += 1; - } - } - } - } else { /* x < 0 */ - if(esy>=0||esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))){ - /* x < y, x -= ulp */ - if(lx==0) { - if (ix != 0 && hx == 0x80000000) hx = 0; - if (hx==0) esx -= 1; - hx -= 1; - } - lx -= 1; - } else { /* x > y, x += ulp */ - lx += 1; - if(lx==0) { - hx += 1; - if (hx==0) { - hx = 0x80000000; - esx += 1; - } - } - } - } - esy = esx&0x7fff; - if(esy==0x7fff) return x+x; /* overflow */ - if(esy==0 && (hx & 0x80000000) == 0) { /* underflow */ - y = x*x; - if(y!=x) { /* raise underflow flag */ - SET_LDOUBLE_WORDS(y,esx,hx,lx); - return y; - } - } - SET_LDOUBLE_WORDS(x,esx,hx,lx); - return x; -} -weak_alias (__nextafterl, nextafterl) -strong_alias (__nextafterl, __nexttowardl) -weak_alias (__nextafterl, nexttowardl) diff --git a/sysdeps/m68k/fpu/s_remquo.c b/sysdeps/m68k/fpu/s_remquo.c deleted file mode 100644 index 5b65f85fbc..0000000000 --- a/sysdeps/m68k/fpu/s_remquo.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Compute remainder and a congruent to the quotient. m68k fpu version - Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - 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 <math.h> - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) - -float_type -s(__remquo) (float_type x, float_type y, int *quo) -{ - float_type result; - int cquo, fpsr; - - __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1" - : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x)); - cquo = (fpsr >> 16) & 0x7f; - if (fpsr & (1 << 23)) - cquo = -cquo; - *quo = cquo; - return result; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__remquo), s(remquo)) diff --git a/sysdeps/m68k/fpu/s_remquof.c b/sysdeps/m68k/fpu/s_remquof.c deleted file mode 100644 index 8a292fc26c..0000000000 --- a/sysdeps/m68k/fpu/s_remquof.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_remquo.c> diff --git a/sysdeps/m68k/fpu/s_remquol.c b/sysdeps/m68k/fpu/s_remquol.c deleted file mode 100644 index d236cfd1f9..0000000000 --- a/sysdeps/m68k/fpu/s_remquol.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_remquo.c> diff --git a/sysdeps/m68k/fpu/s_rint.c b/sysdeps/m68k/fpu/s_rint.c deleted file mode 100644 index f0f18c7346..0000000000 --- a/sysdeps/m68k/fpu/s_rint.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC rint -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_rintf.c b/sysdeps/m68k/fpu/s_rintf.c deleted file mode 100644 index 4e00cab0fb..0000000000 --- a/sysdeps/m68k/fpu/s_rintf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC rintf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_rintl.c b/sysdeps/m68k/fpu/s_rintl.c deleted file mode 100644 index 305667b3a1..0000000000 --- a/sysdeps/m68k/fpu/s_rintl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC rintl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_scalbln.c b/sysdeps/m68k/fpu/s_scalbln.c deleted file mode 100644 index 1009713fbc..0000000000 --- a/sysdeps/m68k/fpu/s_scalbln.c +++ /dev/null @@ -1,2 +0,0 @@ -/* Nothing to do. This function is the same as scalbn. So we define an - alias. */ diff --git a/sysdeps/m68k/fpu/s_scalblnf.c b/sysdeps/m68k/fpu/s_scalblnf.c deleted file mode 100644 index 5e558c3540..0000000000 --- a/sysdeps/m68k/fpu/s_scalblnf.c +++ /dev/null @@ -1,2 +0,0 @@ -/* Nothing to do. This function is the same as scalbnf. So we define an - alias. */ diff --git a/sysdeps/m68k/fpu/s_scalblnl.c b/sysdeps/m68k/fpu/s_scalblnl.c deleted file mode 100644 index cda2ec11c8..0000000000 --- a/sysdeps/m68k/fpu/s_scalblnl.c +++ /dev/null @@ -1,2 +0,0 @@ -/* Nothing to do. This function is the same as scalbnl. So we define an - alias. */ diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c deleted file mode 100644 index d76d94d946..0000000000 --- a/sysdeps/m68k/fpu/s_scalbn.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 1996, 1997 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 scalbln __no_scalbln_decl -#define scalblnf __no_scalblnf_decl -#define scalblnl __no_scalblnl_decl -#define __scalbln __no__scalbln_decl -#define __scalblnf __no__scalblnf_decl -#define __scalblnl __no__scalblnl_decl -#include <math.h> -#undef scalbln -#undef scalblnf -#undef scalblnl -#undef __scalbln -#undef __scalblnf -#undef __scalblnl - -#ifndef suffix -#define suffix /*empty*/ -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__scalbn,suffix) (x, exp) - float_type x; - int exp; -{ - return __m81_u(__CONCATX(__scalbn,suffix))(x, exp); -} - -#define weak_aliasx(a,b) weak_alias(a,b) -#define strong_aliasx(a,b) strong_alias(a,b) -weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbn,suffix)) -strong_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(__scalbln,suffix)) -weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbln,suffix)) diff --git a/sysdeps/m68k/fpu/s_scalbnf.c b/sysdeps/m68k/fpu/s_scalbnf.c deleted file mode 100644 index 547971836a..0000000000 --- a/sysdeps/m68k/fpu/s_scalbnf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define suffix f -#define float_type float -#include <s_scalbn.c> diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c deleted file mode 100644 index 874bafb04b..0000000000 --- a/sysdeps/m68k/fpu/s_scalbnl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define suffix l -#define float_type long double -#include <s_scalbn.c> diff --git a/sysdeps/m68k/fpu/s_significand.c b/sysdeps/m68k/fpu/s_significand.c deleted file mode 100644 index 34d4ea3d14..0000000000 --- a/sysdeps/m68k/fpu/s_significand.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC significand -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_significandf.c b/sysdeps/m68k/fpu/s_significandf.c deleted file mode 100644 index 4e769ca317..0000000000 --- a/sysdeps/m68k/fpu/s_significandf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC significandf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_significandl.c b/sysdeps/m68k/fpu/s_significandl.c deleted file mode 100644 index 8c6fc7e610..0000000000 --- a/sysdeps/m68k/fpu/s_significandl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC significandl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_sin.c b/sysdeps/m68k/fpu/s_sin.c deleted file mode 100644 index 0d4abdbfe4..0000000000 --- a/sysdeps/m68k/fpu/s_sin.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC sin -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_sincos.c b/sysdeps/m68k/fpu/s_sincos.c deleted file mode 100644 index 5df4a5a1c0..0000000000 --- a/sysdeps/m68k/fpu/s_sincos.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1997 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 <math.h> - -#ifndef FUNC -#define FUNC sincos -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) - -void -CONCATX(__,FUNC) (x, sinx, cosx) - float_type x, *sinx, *cosx; -{ - __m81_u(CONCATX(__,FUNC))(x, sinx, cosx); -} - -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (CONCATX(__,FUNC), FUNC) diff --git a/sysdeps/m68k/fpu/s_sincosf.c b/sysdeps/m68k/fpu/s_sincosf.c deleted file mode 100644 index 7ee2ec6600..0000000000 --- a/sysdeps/m68k/fpu/s_sincosf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC sincosf -#define float_type float -#include <s_sincos.c> diff --git a/sysdeps/m68k/fpu/s_sincosl.c b/sysdeps/m68k/fpu/s_sincosl.c deleted file mode 100644 index f998cc0977..0000000000 --- a/sysdeps/m68k/fpu/s_sincosl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC sincosl -#define float_type long double -#include <s_sincos.c> diff --git a/sysdeps/m68k/fpu/s_sinf.c b/sysdeps/m68k/fpu/s_sinf.c deleted file mode 100644 index 9b23d4823f..0000000000 --- a/sysdeps/m68k/fpu/s_sinf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC sinf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_sinl.c b/sysdeps/m68k/fpu/s_sinl.c deleted file mode 100644 index 9ac532cb47..0000000000 --- a/sysdeps/m68k/fpu/s_sinl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC sinl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_tan.c b/sysdeps/m68k/fpu/s_tan.c deleted file mode 100644 index ca7fb0e6dc..0000000000 --- a/sysdeps/m68k/fpu/s_tan.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tan -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_tanf.c b/sysdeps/m68k/fpu/s_tanf.c deleted file mode 100644 index 95fe9c71a5..0000000000 --- a/sysdeps/m68k/fpu/s_tanf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tanf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_tanh.c b/sysdeps/m68k/fpu/s_tanh.c deleted file mode 100644 index ac2e7dbb79..0000000000 --- a/sysdeps/m68k/fpu/s_tanh.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tanh -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_tanhf.c b/sysdeps/m68k/fpu/s_tanhf.c deleted file mode 100644 index 1addaae4ff..0000000000 --- a/sysdeps/m68k/fpu/s_tanhf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tanhf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_tanhl.c b/sysdeps/m68k/fpu/s_tanhl.c deleted file mode 100644 index 6e997911f2..0000000000 --- a/sysdeps/m68k/fpu/s_tanhl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tanhl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_tanl.c b/sysdeps/m68k/fpu/s_tanl.c deleted file mode 100644 index 64fcb54406..0000000000 --- a/sysdeps/m68k/fpu/s_tanl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC tanl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/s_trunc.c b/sysdeps/m68k/fpu/s_trunc.c deleted file mode 100644 index 96f29a776c..0000000000 --- a/sysdeps/m68k/fpu/s_trunc.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC trunc -#include <s_atan.c> diff --git a/sysdeps/m68k/fpu/s_truncf.c b/sysdeps/m68k/fpu/s_truncf.c deleted file mode 100644 index 44dca748ca..0000000000 --- a/sysdeps/m68k/fpu/s_truncf.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC truncf -#include <s_atanf.c> diff --git a/sysdeps/m68k/fpu/s_truncl.c b/sysdeps/m68k/fpu/s_truncl.c deleted file mode 100644 index 8d35777aed..0000000000 --- a/sysdeps/m68k/fpu/s_truncl.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC truncl -#include <s_atanl.c> diff --git a/sysdeps/m68k/fpu/sincos32.c b/sysdeps/m68k/fpu/sincos32.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/sincos32.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/slowexp.c b/sysdeps/m68k/fpu/slowexp.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/slowexp.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/slowpow.c b/sysdeps/m68k/fpu/slowpow.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/m68k/fpu/slowpow.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/m68k/fpu/switch/68881-sw.h b/sysdeps/m68k/fpu/switch/68881-sw.h deleted file mode 100644 index c5a0f71fa6..0000000000 --- a/sysdeps/m68k/fpu/switch/68881-sw.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 1991, 1992, 1997, 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 _68881_SWITCH_H - -#define _68881_SWITCH_H 1 -#include <sys/cdefs.h> - -/* This is the format of the data at the code label for a function which - wants to switch depending on whether or not a 68881 is present. - - Initially, `insn' is a `jsr' instruction, and `target' is __68881_switch. - The first time such a function is called, __68881_switch determines whether - or not a 68881 is present, and modifies the function accordingly. - Then `insn' is a `jmp' instruction, and `target' is the value of `fpu' - if there is 68881, or the value of `soft' if not. */ - -struct switch_caller - { - unsigned short int insn; /* The `jsr' or `jmp' instruction. */ - void *target; /* The target of the instruction. */ - void *soft; /* The address of the soft function. */ - void *fpu; /* The address of the 68881 function. */ - }; - -/* These are opcodes (values for `insn', above) for `jmp' and `jsr' - instructions, respectively, to 32-bit absolute addresses. */ -#define JMP 0x4ef9 -#define JSR 0x4eb9 - - -/* Function to determine whether or not a 68881 is available, - and modify its caller (which must be a `struct switch_caller', above, - in data space) to use the appropriate version. */ -extern void __68881_switch (int __dummy) __THROW; - - -/* Define FUNCTION as a `struct switch_caller' which will call - `__FUNCTION_68881' if a 68881 is present, and `__FUNCTION_soft' if not. -#define switching_function(FUNCTION) \ - struct switch_caller FUNCTION = \ - { \ - JSR, (__ptr_t) __68881_switch, \ - __CONCAT(__CONCAT(__,FUNCTION),_soft), \ - __CONCAT(__CONCAT(__,FUNCTION),_68881) \ - } - - -#endif /* 68881-switch.h */ diff --git a/sysdeps/m68k/fpu/switch/Makefile b/sysdeps/m68k/fpu/switch/Makefile deleted file mode 100644 index c04107163c..0000000000 --- a/sysdeps/m68k/fpu/switch/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 1991, 1992, 1997 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. - -ifeq ($(subdir),math) - -sysdep_routines := $(sysdep_routines) switch - -# Find all the sources that have 68881 versions. -+68881-sources := \ - $(notdir $(wildcard $(addprefix $(filter %/fpu,$(sysdirs)),$(sources)))) - -# Sysdep directories other than fpu and fpu/switch (this one). -+non68881-dirs := $(filter-out %/fpu %/fpu/switch,$(+sysdep_dirs)) - -# Get a non-68881 version of the target. -+non68881-version = $(firstword $(wildcard $(addsuffix /$@,$(+non68881-dirs)))) - -# Directory containing 68881 sources. -+68881-dir := $(filter %/fpu,$(+sysdep_dirs)) - -# For all the files that have 68881 versions and don't exist already in -# the source directory (math), automatically make ones that switch between -# 68881 and soft versions. -$(addprefix $(objpfx), \ - $(filter-out $(wildcard $(+68881-sources)),$(+68881-sources))): - (echo '#include <68881-sw.h>' ;\ - echo '#define $* __$*_68881' ;\ - echo '#include <$(+68881-dir)/$@>' ;\ - echo '#undef $*' ;\ - echo '#define $* __$*_soft' ;\ - echo '#include <$(non68881-version)>' ;\ - echo '#undef $*' ;\ - echo 'switching_function($*);') > $@-tmp - mv $@-tmp $@ - -endif diff --git a/sysdeps/m68k/fpu/switch/bits/mathinline.h b/sysdeps/m68k/fpu/switch/bits/mathinline.h deleted file mode 100644 index c0f6966981..0000000000 --- a/sysdeps/m68k/fpu/switch/bits/mathinline.h +++ /dev/null @@ -1 +0,0 @@ -/* We don't want any inlines when we might not have a 68881. */ diff --git a/sysdeps/m68k/fpu/switch/switch.c b/sysdeps/m68k/fpu/switch/switch.c deleted file mode 100644 index e0558176dc..0000000000 --- a/sysdeps/m68k/fpu/switch/switch.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (C) 1991, 1992, 1997 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 <signal.h> -#include <68881-sw.h> - - -/* The signal that is sent when a 68881 instruction - is executed and there is no 68881. */ -#ifndef TRAPSIG -#define TRAPSIG SIGILL -#endif - -/* Zero if no 68881, one if we have a 68881, or -1 if we don't know yet. */ -static int have_fpu = -1; - - -/* Signal handler for the trap that happens if we don't have a 68881. */ -static void -trap (sig) - int sig; -{ - have_fpu = 0; -} - -/* This function is called by functions that want to switch. - The calling function must be a `struct switch_caller' in data space. - It determines whether a 68881 is present, and modifies its caller - to be a static jump to either the 68881 version or the soft version. - It then returns into the function it has chosen to do the work. */ -void -__68881_switch (dummy) - int dummy; -{ - void **return_address_location = &((void **) &dummy)[-1]; - struct switch_caller *const caller - = (struct switch_caller *) (((short int *) *return_address_location) - 1); - - if (have_fpu < 0) - { - /* Figure out whether or not we have a 68881. */ - __sighandler_t handler = signal (TRAPSIG, trap); - if (handler == SIG_ERR) - /* We can't figure it out, so assume we don't have a 68881. - This assumption will never cause us any problems other than - lost performance, while the reverse assumption could cause - the program to crash. */ - have_fpu = 0; - else - { - /* We set `have_fpu' to nonzero, and then execute a 68881 - no-op instruction. If we have a 68881, this will do nothing. - If we don't have one, this will trap and the signal handler - will clear `have_fpu'. */ - have_fpu = 1; - asm ("fnop"); - - /* Restore the old signal handler. */ - (void) signal (TRAPSIG, handler); - } - } - - /* Modify the caller to be a jump to the appropriate address. */ - caller->insn = JMP; - caller->target = have_fpu ? caller->fpu : caller->soft; - - /* Make the address we will return to be the target we have chosen. - Our return will match the `jsr' done by the caller we have - just modified, and it will be just as if that had instead - been a `jmp' to the new target. */ - *return_address_location = caller->target; -} diff --git a/sysdeps/m68k/fpu/t_exp.c b/sysdeps/m68k/fpu/t_exp.c deleted file mode 100644 index fd37963b05..0000000000 --- a/sysdeps/m68k/fpu/t_exp.c +++ /dev/null @@ -1 +0,0 @@ -/* Empty. Not needed. */ diff --git a/sysdeps/m68k/fpu_control.h b/sysdeps/m68k/fpu_control.h deleted file mode 100644 index 86358e6559..0000000000 --- a/sysdeps/m68k/fpu_control.h +++ /dev/null @@ -1,101 +0,0 @@ -/* 68k FPU control word definitions. - Copyright (C) 1996, 1997, 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. */ - -#ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H - -/* - * Motorola floating point control register bits. - * - * 31-16 -> reserved (read as 0, ignored on write) - * 15 -> enable trap for BSUN exception - * 14 -> enable trap for SNAN exception - * 13 -> enable trap for OPERR exception - * 12 -> enable trap for OVFL exception - * 11 -> enable trap for UNFL exception - * 10 -> enable trap for DZ exception - * 9 -> enable trap for INEX2 exception - * 8 -> enable trap for INEX1 exception - * 7-6 -> Precision Control - * 5-4 -> Rounding Control - * 3-0 -> zero (read as 0, write as 0) - * - * - * Precision Control: - * 00 - round to extended precision - * 01 - round to single precision - * 10 - round to double precision - * 11 - undefined - * - * Rounding Control: - * 00 - rounding to nearest (RN) - * 01 - rounding toward zero (RZ) - * 10 - rounding (down)toward minus infinity (RM) - * 11 - rounding (up) toward plus infinity (RP) - * - * The hardware default is 0x0000. I choose 0x5400. - */ - -#include <features.h> - -/* masking of interrupts */ -#define _FPU_MASK_BSUN 0x8000 -#define _FPU_MASK_SNAN 0x4000 -#define _FPU_MASK_OPERR 0x2000 -#define _FPU_MASK_OVFL 0x1000 -#define _FPU_MASK_UNFL 0x0800 -#define _FPU_MASK_DZ 0x0400 -#define _FPU_MASK_INEX1 0x0200 -#define _FPU_MASK_INEX2 0x0100 - -/* precision control */ -#define _FPU_EXTENDED 0x00 /* RECOMMENDED */ -#define _FPU_DOUBLE 0x80 -#define _FPU_SINGLE 0x40 /* DO NOT USE */ - -/* rounding control */ -#define _FPU_RC_NEAREST 0x00 /* RECOMMENDED */ -#define _FPU_RC_ZERO 0x10 -#define _FPU_RC_DOWN 0x20 -#define _FPU_RC_UP 0x30 - -#define _FPU_RESERVED 0xFFFF000F /* Reserved bits in fpucr */ - - -/* Now two recommended fpucr */ - -/* The fdlibm code requires no interrupts for exceptions. Don't - change the rounding mode, it would break long double I/O! */ -#define _FPU_DEFAULT 0x00000000 - -/* IEEE: same as above, but exceptions. We must make it non-zero so - that __setfpucw works. This bit will be ignored. */ -#define _FPU_IEEE 0x00000001 - -/* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); - -/* Macros for accessing the hardware control word. */ -#define _FPU_GETCW(cw) __asm__ ("fmove%.l %!, %0" : "=dm" (cw)) -#define _FPU_SETCW(cw) __asm__ volatile ("fmove%.l %0, %!" : : "dm" (cw)) - -/* Default control word set at startup. */ -extern fpu_control_t __fpu_control; - -#endif /* _M68K_FPU_CONTROL_H */ diff --git a/sysdeps/m68k/gccframe.h b/sysdeps/m68k/gccframe.h deleted file mode 100644 index 452f53f626..0000000000 --- a/sysdeps/m68k/gccframe.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Definition of object in frame unwind info. m68k version. - Copyright (C) 2001 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 FIRST_PSEUDO_REGISTER 24 - -#include <sysdeps/generic/gccframe.h> diff --git a/sysdeps/m68k/lshift.S b/sysdeps/m68k/lshift.S deleted file mode 100644 index 434b344bd4..0000000000 --- a/sysdeps/m68k/lshift.S +++ /dev/null @@ -1,147 +0,0 @@ -/* mc68020 __mpn_lshift -- Shift left a low-level natural-number integer. - -Copyright (C) 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s_ptr (sp + 8) - s_size (sp + 16) - cnt (sp + 12) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - -#define res_ptr a1 -#define s_ptr a0 -#define s_size d6 -#define cnt d4 - - TEXT -ENTRY(__mpn_lshift) - -/* Save used registers on the stack. */ - moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) - -/* Copy the arguments to registers. */ - movel MEM_DISP(sp,28),R(res_ptr) - movel MEM_DISP(sp,32),R(s_ptr) - movel MEM_DISP(sp,36),R(s_size) - movel MEM_DISP(sp,40),R(cnt) - - moveql #1,R(d5) - cmpl R(d5),R(cnt) - bne L(Lnormal) - cmpl R(s_ptr),R(res_ptr) - bls L(Lspecial) /* jump if s_ptr >= res_ptr */ -#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) - lea MEM_INDX1(s_ptr,s_size,l,4),R(a2) -#else /* not mc68020 */ - movel R(s_size),R(d0) - asll #2,R(d0) - lea MEM_INDX(s_ptr,d0,l),R(a2) -#endif - cmpl R(res_ptr),R(a2) - bls L(Lspecial) /* jump if res_ptr >= s_ptr + s_size */ - -L(Lnormal:) - moveql #32,R(d5) - subl R(cnt),R(d5) - -#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) - lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) - lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr) -#else /* not mc68000 */ - movel R(s_size),R(d0) - asll #2,R(d0) - addl R(s_size),R(s_ptr) - addl R(s_size),R(res_ptr) -#endif - movel MEM_PREDEC(s_ptr),R(d2) - movel R(d2),R(d0) - lsrl R(d5),R(d0) /* compute carry limb */ - - lsll R(cnt),R(d2) - movel R(d2),R(d1) - subql #1,R(s_size) - beq L(Lend) - lsrl #1,R(s_size) - bcs L(L1) - subql #1,R(s_size) - -L(Loop:) - movel MEM_PREDEC(s_ptr),R(d2) - movel R(d2),R(d3) - lsrl R(d5),R(d3) - orl R(d3),R(d1) - movel R(d1),MEM_PREDEC(res_ptr) - lsll R(cnt),R(d2) -L(L1:) - movel MEM_PREDEC(s_ptr),R(d1) - movel R(d1),R(d3) - lsrl R(d5),R(d3) - orl R(d3),R(d2) - movel R(d2),MEM_PREDEC(res_ptr) - lsll R(cnt),R(d1) - - dbf R(s_size),L(Loop) - subl #0x10000,R(s_size) - bcc L(Loop) - -L(Lend:) - movel R(d1),MEM_PREDEC(res_ptr) /* store least significant limb */ - -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) - rts - -/* We loop from least significant end of the arrays, which is only - permissible if the source and destination don't overlap, since the - function is documented to work for overlapping source and destination. */ - -L(Lspecial:) - clrl R(d0) /* initialize carry */ - eorw #1,R(s_size) - lsrl #1,R(s_size) - bcc L(LL1) - subql #1,R(s_size) - -L(LLoop:) - movel MEM_POSTINC(s_ptr),R(d2) - addxl R(d2),R(d2) - movel R(d2),MEM_POSTINC(res_ptr) -L(LL1:) - movel MEM_POSTINC(s_ptr),R(d2) - addxl R(d2),R(d2) - movel R(d2),MEM_POSTINC(res_ptr) - - dbf R(s_size),L(LLoop) - addxl R(d0),R(d0) /* save cy in lsb */ - subl #0x10000,R(s_size) - bcs L(LLend) - lsrl #1,R(d0) /* restore cy */ - bra L(LLoop) - -L(LLend:) -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) - rts -END(__mpn_lshift) diff --git a/sysdeps/m68k/m68020/Makefile b/sysdeps/m68k/m68020/Makefile deleted file mode 100644 index b17635467d..0000000000 --- a/sysdeps/m68k/m68020/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(subdir),db2) -CPPFLAGS += -DHAVE_SPINLOCKS=1 -DHAVE_ASSEM_MC68020_GCC=1 -endif diff --git a/sysdeps/m68k/m68020/addmul_1.S b/sysdeps/m68k/m68020/addmul_1.S deleted file mode 100644 index 05d1d8a804..0000000000 --- a/sysdeps/m68k/m68020/addmul_1.S +++ /dev/null @@ -1,80 +0,0 @@ -/* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add - the result to a second limb vector. - -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s1_ptr (sp + 8) - s1_size (sp + 12) - s2_limb (sp + 16) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - - TEXT -ENTRY(__mpn_addmul_1) - -#define res_ptr a0 -#define s1_ptr a1 -#define s1_size d2 -#define s2_limb d4 - -/* Save used registers on the stack. */ - moveml R(d2)-R(d5),MEM_PREDEC(sp) - -/* Copy the arguments to registers. Better use movem? */ - movel MEM_DISP(sp,20),R(res_ptr) - movel MEM_DISP(sp,24),R(s1_ptr) - movel MEM_DISP(sp,28),R(s1_size) - movel MEM_DISP(sp,32),R(s2_limb) - - eorw #1,R(s1_size) - clrl R(d1) - clrl R(d5) - lsrl #1,R(s1_size) - bcc L(L1) - subql #1,R(s1_size) - subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ - -L(Loop:) - movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d1):R(d3) - addxl R(d0),R(d3) - addxl R(d5),R(d1) - addl R(d3),MEM_POSTINC(res_ptr) -L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d0):R(d3) - addxl R(d1),R(d3) - addxl R(d5),R(d0) - addl R(d3),MEM_POSTINC(res_ptr) - - dbf R(s1_size),L(Loop) - addxl R(d5),R(d0) - subl #0x10000,R(s1_size) - bcc L(Loop) - -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d5) - - rts -END(__mpn_addmul_1) diff --git a/sysdeps/m68k/m68020/bits/atomic.h b/sysdeps/m68k/m68020/bits/atomic.h deleted file mode 100644 index 6b6db71465..0000000000 --- a/sysdeps/m68k/m68020/bits/atomic.h +++ /dev/null @@ -1,254 +0,0 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>, 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <stdint.h> - - -typedef int8_t atomic8_t; -typedef uint8_t uatomic8_t; -typedef int_fast8_t atomic_fast8_t; -typedef uint_fast8_t uatomic_fast8_t; - -typedef int16_t atomic16_t; -typedef uint16_t uatomic16_t; -typedef int_fast16_t atomic_fast16_t; -typedef uint_fast16_t uatomic_fast16_t; - -typedef int32_t atomic32_t; -typedef uint32_t uatomic32_t; -typedef int_fast32_t atomic_fast32_t; -typedef uint_fast32_t uatomic_fast32_t; - -typedef int64_t atomic64_t; -typedef uint64_t uatomic64_t; -typedef int_fast64_t atomic_fast64_t; -typedef uint_fast64_t uatomic_fast64_t; - -typedef intptr_t atomicptr_t; -typedef uintptr_t uatomicptr_t; -typedef intmax_t atomic_max_t; -typedef uintmax_t uatomic_max_t; - -#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - ({ __typeof (*(mem)) __ret; \ - __asm __volatile ("cas%.b %0,%2,%1" \ - : "=d" (__ret), "+m" (*(mem)) \ - : "d" (newval), "0" (oldval)); \ - __ret; }) - -#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - ({ __typeof (*(mem)) __ret; \ - __asm __volatile ("cas%.w %0,%2,%1" \ - : "=d" (__ret), "+m" (*(mem)) \ - : "d" (newval), "0" (oldval)); \ - __ret; }) - -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ __typeof (*(mem)) __ret; \ - __asm __volatile ("cas%.l %0,%2,%1" \ - : "=d" (__ret), "+m" (*(mem)) \ - : "d" (newval), "0" (oldval)); \ - __ret; }) - -# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - ({ __typeof (*(mem)) __ret; \ - __typeof (mem) __memp = (mem); \ - __asm __volatile ("cas2%.l %0:%R0,%1:%R1,(%2):(%3)" \ - : "=d" (__ret) \ - : "d" (newval), "r" (__memp), \ - "r" ((char *) __memp + 4), "0" (oldval) \ - : "memory"); \ - __ret; }) - -#define atomic_exchange_acq(mem, newvalue) \ - ({ __typeof (*(mem)) __result = *(mem); \ - if (sizeof (*(mem)) == 1) \ - __asm __volatile ("1: cas%.b %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)) \ - : "d" (newvalue), "0" (__result)); \ - else if (sizeof (*(mem)) == 2) \ - __asm __volatile ("1: cas%.w %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)) \ - : "d" (newvalue), "0" (__result)); \ - else if (sizeof (*(mem)) == 4) \ - __asm __volatile ("1: cas%.l %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)) \ - : "d" (newvalue), "0" (__result)); \ - else \ - { \ - __typeof (mem) __memp = (mem); \ - __asm __volatile ("1: cas2%.l %0:%R0,%1:%R1,(%2):(%3);" \ - " jbne 1b" \ - : "=d" (__result) \ - : "d" (newvalue), "r" (__memp), \ - "r" ((char *) __memp + 4), "0" (__result) \ - : "memory"); \ - } \ - __result; }) - -#define atomic_exchange_and_add(mem, value) \ - ({ __typeof (*(mem)) __result = *(mem); \ - __typeof (*(mem)) __temp; \ - if (sizeof (*(mem)) == 1) \ - __asm __volatile ("1: move%.b %0,%2;" \ - " add%.b %3,%2;" \ - " cas%.b %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)), \ - "=&d" (__temp) \ - : "d" (value), "0" (__result)); \ - else if (sizeof (*(mem)) == 2) \ - __asm __volatile ("1: move%.w %0,%2;" \ - " add%.w %3,%2;" \ - " cas%.w %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)), \ - "=&d" (__temp) \ - : "d" (value), "0" (__result)); \ - else if (sizeof (*(mem)) == 4) \ - __asm __volatile ("1: move%.l %0,%2;" \ - " add%.l %3,%2;" \ - " cas%.l %0,%2,%1;" \ - " jbne 1b" \ - : "=d" (__result), "+m" (*(mem)), \ - "=&d" (__temp) \ - : "d" (value), "0" (__result)); \ - else \ - { \ - __typeof (mem) __memp = (mem); \ - __asm __volatile ("1: move%.l %0,%1;" \ - " move%.l %R0,%R1;" \ - " add%.l %2,%1;" \ - " addx%.l %R2,%R1;" \ - " cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \ - " jbne 1b" \ - : "=d" (__result), "=&d" (__temp) \ - : "d" (value), "r" (__memp), \ - "r" ((char *) __memp + 4), "0" (__result) \ - : "memory"); \ - } \ - __result; }) - -#define atomic_add(mem, value) \ - (void) ({ if (sizeof (*(mem)) == 1) \ - __asm __volatile ("add%.b %1,%0" \ - : "+m" (*(mem)) \ - : "id" (value)); \ - else if (sizeof (*(mem)) == 2) \ - __asm __volatile ("add%.w %1,%0" \ - : "+m" (*(mem)) \ - : "id" (value)); \ - else if (sizeof (*(mem)) == 4) \ - __asm __volatile ("add%.l %1,%0" \ - : "+m" (*(mem)) \ - : "id" (value)); \ - else \ - { \ - __typeof (mem) __memp = (mem); \ - __typeof (*(mem)) __oldval = *__memp; \ - __typeof (*(mem)) __temp; \ - __asm __volatile ("1: move%.l %0,%1;" \ - " move%.l %R0,%R1;" \ - " add%.l %2,%1;" \ - " addx%.l %R2,%R1;" \ - " cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \ - " jbne 1b" \ - : "=d" (__oldval), "=&d" (__temp) \ - : "d" (value), "r" (__memp), \ - "r" ((char *) __memp + 4), "0" (__oldval) \ - : "memory"); \ - } \ - }) - -#define atomic_increment_and_test(mem) \ - ({ char __result; \ - if (sizeof (*(mem)) == 1) \ - __asm __volatile ("addq%.b %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else if (sizeof (*(mem)) == 2) \ - __asm __volatile ("addq%.w %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else if (sizeof (*(mem)) == 4) \ - __asm __volatile ("addq%.l %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else \ - { \ - __typeof (mem) __memp = (mem); \ - __typeof (*(mem)) __oldval = *__memp; \ - __typeof (*(mem)) __temp; \ - __asm __volatile ("1: move%.l %1,%2;" \ - " move%.l %R1,%R2;" \ - " addq%.l %#1,%2;" \ - " addx%.l %5,%R2;" \ - " seq %0;" \ - " cas2%.l %1:%R1,%2:%R2,(%3):(%4);" \ - " jbne 1b" \ - : "=&dm" (__result), "=d" (__oldval), \ - "=&d" (__temp) \ - : "r" (__memp), "r" ((char *) __memp + 4), \ - "d" (0), "1" (__oldval) \ - : "memory"); \ - } \ - __result; }) - -#define atomic_decrement_and_test(mem) \ - ({ char __result; \ - if (sizeof (*(mem)) == 1) \ - __asm __volatile ("subq%.b %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else if (sizeof (*(mem)) == 2) \ - __asm __volatile ("subq%.w %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else if (sizeof (*(mem)) == 4) \ - __asm __volatile ("subq%.l %#1,%1; seq %0" \ - : "=dm" (__result), "+m" (*(mem))); \ - else \ - { \ - __typeof (mem) __memp = (mem); \ - __typeof (*(mem)) __oldval = *__memp; \ - __typeof (*(mem)) __temp; \ - __asm __volatile ("1: move%.l %1,%2;" \ - " move%.l %R1,%R2;" \ - " subq%.l %#1,%2;" \ - " subx%.l %5,%R2;" \ - " seq %0;" \ - " cas2%.l %1:%R1,%2:%R2,(%3):(%4);" \ - " jbne 1b" \ - : "=&dm" (__result), "=d" (__oldval), \ - "=&d" (__temp) \ - : "r" (__memp), "r" ((char *) __memp + 4), \ - "d" (0), "1" (__oldval) \ - : "memory"); \ - } \ - __result; }) - -#define atomic_bit_set(mem, bit) \ - __asm __volatile ("bfset %0{%1,#1}" \ - : "+m" (*(mem)) \ - : "di" (sizeof (*(mem)) * 8 - (bit) - 1)) - -#define atomic_bit_test_set(mem, bit) \ - ({ char __result; \ - __asm __volatile ("bfset %1{%2,#1}; sne %0" \ - : "=dm" (__result), "+m" (*(mem)) \ - : "di" (sizeof (*(mem)) * 8 - (bit) - 1)); \ - __result; }) diff --git a/sysdeps/m68k/m68020/bits/string.h b/sysdeps/m68k/m68020/bits/string.h deleted file mode 100644 index 84be224b73..0000000000 --- a/sysdeps/m68k/m68020/bits/string.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Optimized, inlined string functions. m680x0 version, x >= 2. - Copyright (C) 1997 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 _STRING_H -# error "Never use <bits/string.h> directly; include <string.h> instead." -#endif - -/* Currently the only purpose of this file is to tell the generic inline - macros that unaligned memory access is possible. */ -#define _STRING_ARCH_unaligned 1 diff --git a/sysdeps/m68k/m68020/mul_1.S b/sysdeps/m68k/m68020/mul_1.S deleted file mode 100644 index f3e450ed93..0000000000 --- a/sysdeps/m68k/m68020/mul_1.S +++ /dev/null @@ -1,87 +0,0 @@ -/* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store - the result in a second limb vector. - -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s1_ptr (sp + 8) - s1_size (sp + 12) - s2_limb (sp + 16) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - - TEXT -ENTRY(__mpn_mul_1) - -#define res_ptr a0 -#define s1_ptr a1 -#define s1_size d2 -#define s2_limb d4 - -/* Save used registers on the stack. */ - moveml R(d2)-R(d4),MEM_PREDEC(sp) -#if 0 - movel R(d2),MEM_PREDEC(sp) - movel R(d3),MEM_PREDEC(sp) - movel R(d4),MEM_PREDEC(sp) -#endif - -/* Copy the arguments to registers. Better use movem? */ - movel MEM_DISP(sp,16),R(res_ptr) - movel MEM_DISP(sp,20),R(s1_ptr) - movel MEM_DISP(sp,24),R(s1_size) - movel MEM_DISP(sp,28),R(s2_limb) - - eorw #1,R(s1_size) - clrl R(d1) - lsrl #1,R(s1_size) - bcc L(L1) - subql #1,R(s1_size) - subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ - -L(Loop:) - movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d1):R(d3) - addxl R(d0),R(d3) - movel R(d3),MEM_POSTINC(res_ptr) -L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d0):R(d3) - addxl R(d1),R(d3) - movel R(d3),MEM_POSTINC(res_ptr) - - dbf R(s1_size),L(Loop) - clrl R(d3) - addxl R(d3),R(d0) - subl #0x10000,R(s1_size) - bcc L(Loop) - -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d4) -#if 0 - movel MEM_POSTINC(sp),R(d4) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) -#endif - rts -END(__mpn_mul_1) diff --git a/sysdeps/m68k/m68020/submul_1.S b/sysdeps/m68k/m68020/submul_1.S deleted file mode 100644 index 7522046b43..0000000000 --- a/sysdeps/m68k/m68020/submul_1.S +++ /dev/null @@ -1,80 +0,0 @@ -/* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract - the result from a second limb vector. - -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s1_ptr (sp + 8) - s1_size (sp + 12) - s2_limb (sp + 16) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - - TEXT -ENTRY(__mpn_submul_1) - -#define res_ptr a0 -#define s1_ptr a1 -#define s1_size d2 -#define s2_limb d4 - -/* Save used registers on the stack. */ - moveml R(d2)-R(d5),MEM_PREDEC(sp) - -/* Copy the arguments to registers. Better use movem? */ - movel MEM_DISP(sp,20),R(res_ptr) - movel MEM_DISP(sp,24),R(s1_ptr) - movel MEM_DISP(sp,28),R(s1_size) - movel MEM_DISP(sp,32),R(s2_limb) - - eorw #1,R(s1_size) - clrl R(d1) - clrl R(d5) - lsrl #1,R(s1_size) - bcc L(L1) - subql #1,R(s1_size) - subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ - -L(Loop:) - movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d1):R(d3) - addxl R(d0),R(d3) - addxl R(d5),R(d1) - subl R(d3),MEM_POSTINC(res_ptr) -L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) - mulul R(s2_limb),R(d0):R(d3) - addxl R(d1),R(d3) - addxl R(d5),R(d0) - subl R(d3),MEM_POSTINC(res_ptr) - - dbf R(s1_size),L(Loop) - addxl R(d5),R(d0) - subl #0x10000,R(s1_size) - bcc L(Loop) - -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d5) - - rts -END(__mpn_submul_1) diff --git a/sysdeps/m68k/m68020/wordcopy.S b/sysdeps/m68k/m68020/wordcopy.S deleted file mode 100644 index 4fb1a4518f..0000000000 --- a/sysdeps/m68k/m68020/wordcopy.S +++ /dev/null @@ -1 +0,0 @@ -/* Empty, not needed. */ diff --git a/sysdeps/m68k/memchr.S b/sysdeps/m68k/memchr.S deleted file mode 100644 index fab65a9aea..0000000000 --- a/sysdeps/m68k/memchr.S +++ /dev/null @@ -1,232 +0,0 @@ -/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in the - first N bytes of STR. - For Motorola 68000. - Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <sysdep.h> -#include "asm-syntax.h" - - TEXT -ENTRY(__memchr) - /* Save the callee-saved registers we use. */ - moveml R(d2)-R(d4),MEM_PREDEC(sp) - - /* Get string pointer, character and length. */ - movel MEM_DISP(sp,16),R(a0) - moveb MEM_DISP(sp,23),R(d0) - movel MEM_DISP(sp,24),R(d4) - - /* Check if at least four bytes left to search. */ - moveql #4,R(d1) - cmpl R(d1),R(d4) - bcs L(L6) - - /* Distribute the character to all bytes of a longword. */ - movel R(d0),R(d1) - lsll #8,R(d1) - moveb R(d0),R(d1) - movel R(d1),R(d0) - swap R(d0) - movew R(d1),R(d0) - - /* First search for the character one byte at a time until the - pointer is aligned to a longword boundary. */ - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - subql #1,R(d4) - beq L(L7) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - subql #1,R(d4) - beq L(L7) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - subql #1,R(d4) - beq L(L7) - -L(L1:) - /* Load the magic bits. Unlike the generic implementation we can - use the carry bit as the fourth hole. */ - movel #0xfefefeff,R(d3) - - /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to - change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-31 is set, there will be a carry - into bit 32 (=carry flag), so all of the hole bits will - be changed. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - /* Still at least 4 bytes to search? */ - subql #4,R(d4) - bcs L(L6) - -L(L2:) - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Still at least 4 bytes to search? */ - subql #4,R(d4) - bcs L(L6) - - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Still at least 4 bytes to search? */ - subql #4,R(d4) - bcc L(L2) - -L(L6:) - /* Search one byte at a time in the remaining less than 4 bytes. */ - andw #3,R(d4) - beq L(L7) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - subqw #1,R(d4) - beq L(L7) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - subqw #1,R(d4) - beq L(L7) - cmpb MEM(a0),R(d0) - beq L(L9) - -L(L7:) - /* Return NULL. */ - clrl R(d0) - movel R(d0),R(a0) - moveml MEM_POSTINC(sp),R(d2)-R(d4) - rts - -L(L8:) - /* We have a hit. Check to see which byte it was. First - compensate for the autoincrement in the loop. */ - subql #4,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - /* Otherwise the fourth byte must equal C. */ -L(L9:) - movel R(a0),R(d0) - moveml MEM_POSTINC(sp),R(d2)-R(d4) - rts -END(__memchr) - -weak_alias (__memchr, memchr) -#if !__BOUNDED_POINTERS__ -weak_alias (__memchr, __ubp_memchr) -#endif -libc_hidden_builtin_def (memchr) diff --git a/sysdeps/m68k/memcopy.h b/sysdeps/m68k/memcopy.h deleted file mode 100644 index 0951eeaf7a..0000000000 --- a/sysdeps/m68k/memcopy.h +++ /dev/null @@ -1,100 +0,0 @@ -/* memcopy.h -- definitions for memory copy functions. Motorola 68020 version. - Copyright (C) 1991, 1997, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Torbjorn Granlund (tege@sics.se). - - 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 <sysdeps/generic/memcopy.h> - -#if defined(__mc68020__) || defined(mc68020) - -#undef OP_T_THRES -#define OP_T_THRES 16 - -/* WORD_COPY_FWD and WORD_COPY_BWD are not symmetric on the 68020, - because of its weird instruction overlap characteristics. */ - -#undef WORD_COPY_FWD -#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \ - do \ - { \ - size_t __nwords = (nbytes) / sizeof (op_t); \ - size_t __nblocks = __nwords / 8 + 1; \ - dst_bp -= (8 - __nwords % 8) * sizeof (op_t); \ - src_bp -= (8 - __nwords % 8) * sizeof (op_t); \ - switch (__nwords % 8) \ - do \ - { \ - ((op_t *) dst_bp)[0] = ((op_t *) src_bp)[0]; \ - case 7: \ - ((op_t *) dst_bp)[1] = ((op_t *) src_bp)[1]; \ - case 6: \ - ((op_t *) dst_bp)[2] = ((op_t *) src_bp)[2]; \ - case 5: \ - ((op_t *) dst_bp)[3] = ((op_t *) src_bp)[3]; \ - case 4: \ - ((op_t *) dst_bp)[4] = ((op_t *) src_bp)[4]; \ - case 3: \ - ((op_t *) dst_bp)[5] = ((op_t *) src_bp)[5]; \ - case 2: \ - ((op_t *) dst_bp)[6] = ((op_t *) src_bp)[6]; \ - case 1: \ - ((op_t *) dst_bp)[7] = ((op_t *) src_bp)[7]; \ - case 0: \ - src_bp += 32; \ - dst_bp += 32; \ - __nblocks--; \ - } \ - while (__nblocks != 0); \ - (nbytes_left) = (nbytes) % sizeof (op_t); \ - } while (0) - -#undef WORD_COPY_BWD -#define WORD_COPY_BWD(dst_ep, src_ep, nbytes_left, nbytes) \ - do \ - { \ - size_t __nblocks = (nbytes) / 32 + 1; \ - op_t *__dst_ep = (op_t *) (dst_ep); \ - op_t *__src_ep = (op_t *) (src_ep); \ - switch ((nbytes) / sizeof (op_t) % 8) \ - do \ - { \ - *--__dst_ep = *--__src_ep; \ - case 7: \ - *--__dst_ep = *--__src_ep; \ - case 6: \ - *--__dst_ep = *--__src_ep; \ - case 5: \ - *--__dst_ep = *--__src_ep; \ - case 4: \ - *--__dst_ep = *--__src_ep; \ - case 3: \ - *--__dst_ep = *--__src_ep; \ - case 2: \ - *--__dst_ep = *--__src_ep; \ - case 1: \ - *--__dst_ep = *--__src_ep; \ - case 0: \ - __nblocks--; \ - } \ - while (__nblocks != 0); \ - (nbytes_left) = (nbytes) % sizeof (op_t); \ - (dst_ep) = (unsigned long) __dst_ep; \ - (src_ep) = (unsigned long) __src_ep; \ - } while (0) - -#endif diff --git a/sysdeps/m68k/memusage.h b/sysdeps/m68k/memusage.h deleted file mode 100644 index bb22c0acc0..0000000000 --- a/sysdeps/m68k/memusage.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 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. */ - - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; }) - -#include <sysdeps/generic/memusage.h> diff --git a/sysdeps/m68k/printf_fphex.c b/sysdeps/m68k/printf_fphex.c deleted file mode 100644 index d021a090ab..0000000000 --- a/sysdeps/m68k/printf_fphex.c +++ /dev/null @@ -1,2 +0,0 @@ -#define LONG_DOUBLE_DENORM_BIAS IEEE854_LONG_DOUBLE_BIAS -#include <sysdeps/ieee754/ldbl-96/printf_fphex.c> diff --git a/sysdeps/m68k/rawmemchr.S b/sysdeps/m68k/rawmemchr.S deleted file mode 100644 index acd8f76e44..0000000000 --- a/sysdeps/m68k/rawmemchr.S +++ /dev/null @@ -1,180 +0,0 @@ -/* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR. - For Motorola 68000. - Copyright (C) 1999, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <sysdep.h> -#include "asm-syntax.h" - - TEXT -ENTRY(__rawmemchr) - /* Save the callee-saved registers we use. */ - movel R(d2),MEM_PREDEC(sp) - movel R(d3),MEM_PREDEC(sp) - - /* Get string pointer and character. */ - movel MEM_DISP(sp,12),R(a0) - moveb MEM_DISP(sp,19),R(d0) - - /* Distribute the character to all bytes of a longword. */ - movel R(d0),R(d1) - lsll #8,R(d1) - moveb R(d0),R(d1) - movel R(d1),R(d0) - swap R(d0) - movew R(d1),R(d0) - - /* First search for the character one byte at a time until the - pointer is aligned to a longword boundary. */ - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - -L(L1:) - /* Load the magic bits. Unlike the generic implementation we can - use the carry bit as the fourth hole. */ - movel #0xfefefeff,R(d3) - - /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to - change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-31 is set, there will be a carry - into bit 32 (=carry flag), so all of the hole bits will - be changed. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - -L(L2:) - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - beq L(L2) - -L(L8:) - /* We have a hit. Check to see which byte it was. First - compensate for the autoincrement in the loop. */ - subql #4,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - cmpb MEM(a0),R(d0) - beq L(L9) - addql #1,R(a0) - - /* Otherwise the fourth byte must equal C. */ -L(L9:) - movel R(a0),R(d0) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) - rts -END(__rawmemchr) - -libc_hidden_def (__rawmemchr) -weak_alias (__rawmemchr, rawmemchr) diff --git a/sysdeps/m68k/rshift.S b/sysdeps/m68k/rshift.S deleted file mode 100644 index 5e6abceb97..0000000000 --- a/sysdeps/m68k/rshift.S +++ /dev/null @@ -1,146 +0,0 @@ -/* mc68020 __mpn_rshift -- Shift right a low-level natural-number integer. - -Copyright (C) 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s_ptr (sp + 8) - s_size (sp + 16) - cnt (sp + 12) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - -#define res_ptr a1 -#define s_ptr a0 -#define s_size d6 -#define cnt d4 - - TEXT -ENTRY(__mpn_rshift) -/* Save used registers on the stack. */ - moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) - -/* Copy the arguments to registers. */ - movel MEM_DISP(sp,28),R(res_ptr) - movel MEM_DISP(sp,32),R(s_ptr) - movel MEM_DISP(sp,36),R(s_size) - movel MEM_DISP(sp,40),R(cnt) - - moveql #1,R(d5) - cmpl R(d5),R(cnt) - bne L(Lnormal) - cmpl R(res_ptr),R(s_ptr) - bls L(Lspecial) /* jump if res_ptr >= s_ptr */ -#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) - lea MEM_INDX1(res_ptr,s_size,l,4),R(a2) -#else /* not mc68020 */ - movel R(s_size),R(d0) - asll #2,R(d0) - lea MEM_INDX(res_ptr,d0,l),R(a2) -#endif - cmpl R(s_ptr),R(a2) - bls L(Lspecial) /* jump if s_ptr >= res_ptr + s_size */ - -L(Lnormal:) - moveql #32,R(d5) - subl R(cnt),R(d5) - movel MEM_POSTINC(s_ptr),R(d2) - movel R(d2),R(d0) - lsll R(d5),R(d0) /* compute carry limb */ - - lsrl R(cnt),R(d2) - movel R(d2),R(d1) - subql #1,R(s_size) - beq L(Lend) - lsrl #1,R(s_size) - bcs L(L1) - subql #1,R(s_size) - -L(Loop:) - movel MEM_POSTINC(s_ptr),R(d2) - movel R(d2),R(d3) - lsll R(d5),R(d3) - orl R(d3),R(d1) - movel R(d1),MEM_POSTINC(res_ptr) - lsrl R(cnt),R(d2) -L(L1:) - movel MEM_POSTINC(s_ptr),R(d1) - movel R(d1),R(d3) - lsll R(d5),R(d3) - orl R(d3),R(d2) - movel R(d2),MEM_POSTINC(res_ptr) - lsrl R(cnt),R(d1) - - dbf R(s_size),L(Loop) - subl #0x10000,R(s_size) - bcc L(Loop) - -L(Lend:) - movel R(d1),MEM(res_ptr) /* store most significant limb */ - -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) - rts - -/* We loop from most significant end of the arrays, which is only - permissible if the source and destination don't overlap, since the - function is documented to work for overlapping source and destination. */ - -L(Lspecial:) -#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) - lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) - lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr) -#else /* not mc68000 */ - movel R(s_size),R(d0) - asll #2,R(d0) - addl R(s_size),R(s_ptr) - addl R(s_size),R(res_ptr) -#endif - - clrl R(d0) /* initialize carry */ - eorw #1,R(s_size) - lsrl #1,R(s_size) - bcc L(LL1) - subql #1,R(s_size) - -L(LLoop:) - movel MEM_PREDEC(s_ptr),R(d2) - roxrl #1,R(d2) - movel R(d2),MEM_PREDEC(res_ptr) -L(LL1:) - movel MEM_PREDEC(s_ptr),R(d2) - roxrl #1,R(d2) - movel R(d2),MEM_PREDEC(res_ptr) - - dbf R(s_size),L(LLoop) - roxrl #1,R(d0) /* save cy in msb */ - subl #0x10000,R(s_size) - bcs L(LLend) - addl R(d0),R(d0) /* restore cy */ - bra L(LLoop) - -L(LLend:) -/* Restore used registers from stack frame. */ - moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) - rts -END(__mpn_rshift) diff --git a/sysdeps/m68k/s_isinfl.c b/sysdeps/m68k/s_isinfl.c deleted file mode 100644 index 2502039087..0000000000 --- a/sysdeps/m68k/s_isinfl.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995, 1997, 2002 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 <math.h> -#include "ieee754.h" - -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -int -__isinfl (long double value) -{ - union ieee854_long_double u; - - u.d = value; - - /* An IEEE 854 infinity has an exponent with the - maximum possible value and a zero mantissa. - In Motorola's interpretation the integer bit is ignored. */ - if ((u.ieee.exponent & 0x7fff) == 0x7fff && - (u.ieee.mantissa0 & 0x7fffffff) == 0 && u.ieee.mantissa1 == 0) - return u.ieee.negative ? -1 : 1; - - return 0; -} - -hidden_def (__isinfl) -weak_alias (__isinfl, isinfl); diff --git a/sysdeps/m68k/s_isnanl.c b/sysdeps/m68k/s_isnanl.c deleted file mode 100644 index 999746f29c..0000000000 --- a/sysdeps/m68k/s_isnanl.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995, 1997, 2002 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 <math.h> -#include "ieee754.h" - -/* Return nonzero if VALUE is not a number. */ -int -__isnanl (long double value) -{ - union ieee854_long_double u; - - u.d = value; - - /* IEEE 854 NaN's have the maximum possible - exponent and a nonzero mantissa. In Motorola's - interpretation the integer bit is ignored. */ - return ((u.ieee.exponent & 0x7fff) == 0x7fff && - ((u.ieee.mantissa0 & 0x7fffffff) != 0 || u.ieee.mantissa1 != 0)); -} - -hidden_def (__isnanl) -weak_alias (__isnanl, isnanl); diff --git a/sysdeps/m68k/setjmp.c b/sysdeps/m68k/setjmp.c deleted file mode 100644 index 8a6c3f9a0b..0000000000 --- a/sysdeps/m68k/setjmp.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 1991, 1992, 1994, 1997, 2001 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 <setjmp.h> - -/* Save the current program position in ENV and return 0. */ -int -#if defined BSD_SETJMP -# undef setjmp -# define savemask 1 -setjmp (jmp_buf env) -#elif defined BSD__SETJMP -# undef _setjmp -# define savemask 0 -_setjmp (jmp_buf env) -#else -__sigsetjmp (jmp_buf env, int savemask) -#endif -{ - /* Save data registers D1 through D7. */ - asm volatile ("movem%.l %/d1-%/d7, %0" - : : "m" (env[0].__jmpbuf[0].__dregs[0])); - - /* Save return address in place of register A0. */ - env[0].__jmpbuf[0].__aregs[0] = ((void **) &env)[-1]; - - /* Save address registers A1 through A5. */ - asm volatile ("movem%.l %/a1-%/a5, %0" - : : "m" (env[0].__jmpbuf[0].__aregs[1])); - - /* Save caller's FP, not our own. */ - env[0].__jmpbuf[0].__fp = ((void **) &env)[-2]; - - /* Save caller's SP, not our own. */ - env[0].__jmpbuf[0].__sp = (void *) &env; - -#if defined __HAVE_68881__ || defined __HAVE_FPU__ - /* Save floating-point (68881) registers FP0 through FP7. */ - asm volatile ("fmovem%.x %/fp0-%/fp7, %0" - : : "m" (env[0].__jmpbuf[0].__fpregs[0])); -#endif - - /* Save the signal mask if requested. */ - return __sigjmp_save (env, savemask); -} -#if !defined BSD_SETJMP && !defined BSD__SETJMP -hidden_def (__sigsetjmp) -#endif diff --git a/sysdeps/m68k/stackinfo.h b/sysdeps/m68k/stackinfo.h deleted file mode 100644 index 66e5a17fb4..0000000000 --- a/sysdeps/m68k/stackinfo.h +++ /dev/null @@ -1,28 +0,0 @@ -/* 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/sysdeps/m68k/strchr.S b/sysdeps/m68k/strchr.S deleted file mode 100644 index 04626ffd64..0000000000 --- a/sysdeps/m68k/strchr.S +++ /dev/null @@ -1,258 +0,0 @@ -/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR. - For Motorola 68000. - Copyright (C) 1999, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <sysdep.h> -#include "asm-syntax.h" - - TEXT -ENTRY(strchr) - /* Save the callee-saved registers we use. */ - movel R(d2),MEM_PREDEC(sp) - movel R(d3),MEM_PREDEC(sp) - - /* Get string pointer and character. */ - movel MEM_DISP(sp,12),R(a0) - moveb MEM_DISP(sp,19),R(d0) - - /* Distribute the character to all bytes of a longword. */ - movel R(d0),R(d1) - lsll #8,R(d1) - moveb R(d0),R(d1) - movel R(d1),R(d0) - swap R(d0) - movew R(d1),R(d0) - - /* First search for the character one byte at a time until the - pointer is aligned to a longword boundary. */ - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - -L(L1:) - /* Load the magic bits. Unlike the generic implementation we can - use the carry bit as the fourth hole. */ - movel #0xfefefeff,R(d3) - - /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to - change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-31 is set, there will be a carry - into bit 32 (=carry flag), so all of the hole bits will - be changed. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - -L(L2:) - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Next look for a NUL byte. - Restore original longword without reload. */ - eorl R(d0),R(d1) - /* Add the magic value. We get carry bits reported for each byte - which is not NUL. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit, and return NULL. */ - bcc L(L3) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word was NUL - and we return NULL. Otherwise continue with the next longword. */ - bne L(L3) - - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Next look for a NUL byte. - Restore original longword without reload. */ - eorl R(d0),R(d1) - /* Add the magic value. We get carry bits reported for each byte - which is not NUL. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit, and return NULL. */ - bcc L(L3) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word was NUL - and we return NULL. Otherwise continue with the next longword. */ - beq L(L2) - -L(L3:) - /* Return NULL. */ - clrl R(d0) - movel R(d0),R(a0) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) - rts - -L(L8:) - /* We have a hit. Check to see which byte it was. First - compensate for the autoincrement in the loop. */ - subql #4,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L3) - addql #1,R(a0) - - /* Otherwise the fourth byte must equal C. */ -L(L9:) - movel R(a0),R(d0) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) - rts -END(strchr) - -weak_alias (strchr, index) -libc_hidden_builtin_def (strchr) diff --git a/sysdeps/m68k/strchrnul.S b/sysdeps/m68k/strchrnul.S deleted file mode 100644 index 3fee2b236c..0000000000 --- a/sysdeps/m68k/strchrnul.S +++ /dev/null @@ -1,250 +0,0 @@ -/* strchrnul (str, ch) -- Return pointer to first occurrence of CH in STR - or the final NUL byte. - For Motorola 68000. - Copyright (C) 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <sysdep.h> -#include "asm-syntax.h" - - TEXT -ENTRY(__strchrnul) - /* Save the callee-saved registers we use. */ - movel R(d2),MEM_PREDEC(sp) - movel R(d3),MEM_PREDEC(sp) - - /* Get string pointer and character. */ - movel MEM_DISP(sp,12),R(a0) - moveb MEM_DISP(sp,19),R(d0) - - /* Distribute the character to all bytes of a longword. */ - movel R(d0),R(d1) - lsll #8,R(d1) - moveb R(d0),R(d1) - movel R(d1),R(d0) - swap R(d0) - movew R(d1),R(d0) - - /* First search for the character one byte at a time until the - pointer is aligned to a longword boundary. */ - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - - movel R(a0),R(d1) - andw #3,R(d1) - beq L(L1) - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - -L(L1:) - /* Load the magic bits. Unlike the generic implementation we can - use the carry bit as the fourth hole. */ - movel #0xfefefeff,R(d3) - - /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to - change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-31 is set, there will be a carry - into bit 32 (=carry flag), so all of the hole bits will - be changed. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - -L(L2:) - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Next look for a NUL byte. - Restore original longword without reload. */ - eorl R(d0),R(d1) - /* Add the magic value. We get carry bits reported for each byte - which is not NUL. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits. */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word was - NUL. Otherwise continue with the next longword. */ - bne L(L8) - - /* Get the longword in question. */ - movel MEM_POSTINC(a0),R(d1) - /* XOR with the byte we search for. */ - eorl R(d0),R(d1) - - /* Add the magic value. We get carry bits reported for each byte - which is not C. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word equals - C. */ - bne L(L8) - - /* Next look for a NUL byte. - Restore original longword without reload. */ - eorl R(d0),R(d1) - /* Add the magic value. We get carry bits reported for each byte - which is not NUL. */ - movel R(d3),R(d2) - addl R(d1),R(d2) - - /* Check the fourth carry bit before it is clobbered by the next - XOR. If it is not set we have a hit. */ - bcc L(L8) - - /* We are only interested in carry bits that change due to the - previous add, so remove original bits */ - eorl R(d1),R(d2) - - /* Now test for the other three overflow bits. - Set all non-carry bits. */ - orl R(d3),R(d2) - /* Add 1 to get zero if all carry bits were set. */ - addql #1,R(d2) - - /* If we don't get zero then at least one byte of the word was - NUL. Otherwise continue with the next longword. */ - beq L(L2) - -L(L8:) - /* We have a hit. Check to see which byte it was. First - compensate for the autoincrement in the loop. */ - subql #4,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - - moveb MEM(a0),R(d1) - cmpb R(d0),R(d1) - beq L(L9) - tstb R(d1) - beq L(L9) - addql #1,R(a0) - - /* Otherwise the fourth byte must equal C or be NUL. */ -L(L9:) - movel R(a0),R(d0) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) - rts -END(__strchrnul) - -weak_alias (__strchrnul, strchrnul) diff --git a/sysdeps/m68k/strtold_l.c b/sysdeps/m68k/strtold_l.c deleted file mode 100644 index 481d9924c2..0000000000 --- a/sysdeps/m68k/strtold_l.c +++ /dev/null @@ -1,2 +0,0 @@ -#define DENORM_EXP (MIN_EXP - 1) -#include <sysdeps/ieee754/ldbl-96/strtold_l.c> diff --git a/sysdeps/m68k/sub_n.S b/sysdeps/m68k/sub_n.S deleted file mode 100644 index 5833dd2719..0000000000 --- a/sysdeps/m68k/sub_n.S +++ /dev/null @@ -1,76 +0,0 @@ -/* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and - store difference in a third limb vector. - -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -/* - INPUT PARAMETERS - res_ptr (sp + 4) - s1_ptr (sp + 8) - s2_ptr (sp + 16) - size (sp + 12) -*/ - -#include "sysdep.h" -#include "asm-syntax.h" - - TEXT -ENTRY(__mpn_sub_n) -/* Save used registers on the stack. */ - movel R(d2),MEM_PREDEC(sp) - movel R(a2),MEM_PREDEC(sp) - -/* Copy the arguments to registers. Better use movem? */ - movel MEM_DISP(sp,12),R(a2) - movel MEM_DISP(sp,16),R(a0) - movel MEM_DISP(sp,20),R(a1) - movel MEM_DISP(sp,24),R(d2) - - eorw #1,R(d2) - lsrl #1,R(d2) - bcc L(L1) - subql #1,R(d2) /* clears cy as side effect */ - -L(Loop:) - movel MEM_POSTINC(a0),R(d0) - movel MEM_POSTINC(a1),R(d1) - subxl R(d1),R(d0) - movel R(d0),MEM_POSTINC(a2) -L(L1:) movel MEM_POSTINC(a0),R(d0) - movel MEM_POSTINC(a1),R(d1) - subxl R(d1),R(d0) - movel R(d0),MEM_POSTINC(a2) - - dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */ - subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */ - subl #0x10000,R(d2) - bcs L(L2) - addl R(d0),R(d0) /* restore cy */ - bra L(Loop) - -L(L2:) - negl R(d0) - -/* Restore used registers from stack frame. */ - movel MEM_POSTINC(sp),R(a2) - movel MEM_POSTINC(sp),R(d2) - - rts -END(__mpn_sub_n) diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h deleted file mode 100644 index 857ed6b42a..0000000000 --- a/sysdeps/m68k/sys/ucontext.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 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. */ - -/* System V/m68k ABI compliant context switching support. */ - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <signal.h> - -/* Type for general register. */ -typedef int greg_t; - -/* Number of general registers. */ -#define NGREG 18 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Number of each register is the `gregset_t' array. */ -enum -{ - R_D0 = 0, -#define R_D0 R_D0 - R_D1 = 1, -#define R_D1 R_D1 - R_D2 = 2, -#define R_D2 R_D2 - R_D3 = 3, -#define R_D3 R_D3 - R_D4 = 4, -#define R_D4 R_D4 - R_D5 = 5, -#define R_D5 R_D5 - R_D6 = 6, -#define R_D6 R_D6 - R_D7 = 7, -#define R_D7 R_D7 - R_A0 = 8, -#define R_A0 R_A0 - R_A1 = 9, -#define R_A1 R_A1 - R_A2 = 10, -#define R_A2 R_A2 - R_A3 = 11, -#define R_A3 R_A3 - R_A4 = 12, -#define R_A4 R_A4 - R_A5 = 13, -#define R_A5 R_A5 - R_A6 = 14, -#define R_A6 R_A6 - R_A7 = 15, -#define R_A7 R_A7 - R_SP = 15, -#define R_SP R_SP - R_PC = 16, -#define R_PC R_PC - R_PS = 17 -#define R_PS R_PS -}; - -/* Structure to describe FPU registers. */ -typedef struct fpregset -{ - int f_pcr; - int f_psr; - int f_fpiaddr; - int f_fpregs[8][3]; -} fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct -{ - int version; - gregset_t gregs; -} mcontext_t; - -#define MCONTEXT_VERSION 1 - -/* Userlevel context. */ -typedef struct ucontext -{ - unsigned long int uc_flags; - struct ucontext *uc_link; - __sigset_t uc_sigmask; - stack_t uc_stack; - mcontext_t uc_mcontext; - long int uc_filler[201]; -} ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/m68k/sysdep.h b/sysdeps/m68k/sysdep.h deleted file mode 100644 index f492ff617c..0000000000 --- a/sysdeps/m68k/sysdep.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Assembler macros for m68k. - Copyright (C) 1998, 2003 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 <sysdeps/generic/sysdep.h> - -#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<<log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -# define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg -# define ASM_SIZE_DIRECTIVE(name) .size name,.-name - -/* In ELF C symbols are asm symbols. */ -# undef NO_UNDERSCORES -# define NO_UNDERSCORES - -# else - -# define ALIGNARG(log2) log2 -# define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */ -# define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */ - -# endif - - -/* Define an entry point visible from C. - - There is currently a bug in gdb which prevents us from specifying - incomplete stabs information. Fake some entries here which specify - the current source file. */ -# define ENTRY(name) \ - .globl C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function); \ - .align ALIGNARG(2); \ - C_LABEL(name) \ - CALL_MCOUNT - -# undef END -# define END(name) ASM_SIZE_DIRECTIVE(name) - - -/* If compiled for profiling, call `_mcount' at the start of each function. */ -# ifdef PROF -/* The mcount code relies on a normal frame pointer being on the stack - to locate our caller, so push one just for its benefit. */ -# define CALL_MCOUNT \ - move.l %fp, -(%sp); move.l %sp, %fp; \ - jbsr JUMPTARGET (mcount); \ - move.l (%sp)+, %fp; -# else -# define CALL_MCOUNT /* Do nothing. */ -# endif - -# ifdef NO_UNDERSCORES -/* Since C identifiers are not normally prefixed with an underscore - on this system, the asm identifier `syscall_error' intrudes on the - C name space. Make sure we use an innocuous name. */ -# define syscall_error __syscall_error -# define mcount _mcount -# endif - -# define PSEUDO(name, syscall_name, args) \ - .globl syscall_error; \ - ENTRY (name) \ - DO_CALL (syscall_name, args); \ - jcc JUMPTARGET(syscall_error) - -# undef PSEUDO_END -# define PSEUDO_END(name) \ - END (name) - -# undef JUMPTARGET -# ifdef PIC -# define JUMPTARGET(name) name##@PLTPC -# else -# define JUMPTARGET(name) name -# endif - -#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/mach/Subdirs b/sysdeps/mach/Subdirs index fc6ac35d83..24fa4a3c98 100644 --- a/sysdeps/mach/Subdirs +++ b/sysdeps/mach/Subdirs @@ -1 +1,9 @@ -mach +# This file says that the mach subdirectory should appear before all others. +# The mach and hurd subdirectories have many generated header files which +# much of the rest of the library depends on, so it is best to build them +# first (and mach before hurd, at that). The before-compile additions in +# sysdeps/{mach,hurd}/Makefile should make it reliably work for these files +# not to exist when making in other directories, but it will be slower that +# way with more somewhat expensive `make' invocations. + +first mach diff --git a/sysdeps/mach/hppa/machine-lock.h b/sysdeps/mach/hppa/machine-lock.h deleted file mode 100644 index 8c71d40a5a..0000000000 --- a/sysdeps/mach/hppa/machine-lock.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Machine-specific definition for spin locks. HPPA version. - Copyright (C) 1995, 1997 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 _MACHINE_LOCK_H -#define _MACHINE_LOCK_H - -/* The type of a spin lock variable. */ - -typedef __volatile int __spin_lock_t __attribute__ ((__aligned__ (16))); - -/* Value to initialize `__spin_lock_t' variables to. */ - -#define __SPIN_LOCK_INITIALIZER -1 - - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Unlock LOCK. */ - -_EXTERN_INLINE void -__spin_unlock (__spin_lock_t *__lock) -{ - *__lock = -1; -} - -/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */ - -_EXTERN_INLINE int -__spin_try_lock (__spin_lock_t *__lock) -{ - register int __result; - __asm__ __volatile__ ("ldcws %0, %1" : "=m" (*__lock), "=r" (__result)); - return __result != 0; -} - -/* Return nonzero if LOCK is locked. */ - -_EXTERN_INLINE int -__spin_lock_locked (__spin_lock_t *__lock) -{ - return *__lock == 0; -} - - -#endif /* machine-lock.h */ diff --git a/sysdeps/hppa/fpu/fegetround.c b/sysdeps/mach/hurd/fgetxattr.c index aefedbc071..2eb6db06c7 100644 --- a/sysdeps/hppa/fpu/fegetround.c +++ b/sysdeps/mach/hurd/fgetxattr.c @@ -1,7 +1,6 @@ -/* Return current rounding direction. - Copyright (C) 2000 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,15 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <fenv.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <hurd/fd.h> -int -fegetround (void) +ssize_t +fgetxattr (int fd, const char *name, void *value, size_t size) { - unsigned int sw[2]; + error_t err; - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); + err = HURD_DPORT_USE (fd, _hurd_xattr_get (port, name, value, &size)); - return sw[0] & FE_DOWNWARD; + return err ? __hurd_dfail (fd, err) : size; } diff --git a/sysdeps/hppa/fpu/ftestexcept.c b/sysdeps/mach/hurd/flistxattr.c index d08d4d6eb9..a577e4e393 100644 --- a/sysdeps/hppa/fpu/ftestexcept.c +++ b/sysdeps/mach/hurd/flistxattr.c @@ -1,7 +1,6 @@ -/* Test exception in current environment. - Copyright (C) 2000 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000 The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,15 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <fenv.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <hurd/fd.h> -int -fetestexcept (int excepts) +ssize_t +flistxattr (int fd, char *list, size_t size) { - unsigned int sw[2]; + error_t err; - /* Get the current status word. */ - __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); + err = HURD_DPORT_USE (fd, _hurd_xattr_list (port, list, &size)); - return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT; + return err ? __hurd_dfail (fd, err) : size; } diff --git a/sysdeps/m68k/fpu/fegetexcept.c b/sysdeps/mach/hurd/fremovexattr.c index b34b2c1e20..5d3aca6093 100644 --- a/sysdeps/m68k/fpu/fegetexcept.c +++ b/sysdeps/mach/hurd/fremovexattr.c @@ -1,7 +1,6 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>, 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,15 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <fenv.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <hurd/fd.h> int -fegetexcept (void) +fremovexattr (int fd, const char *name) { - unsigned int exc; + error_t err; - /* Get the current control register contents. */ - __asm__ ("fmove%.l %!,%0" : "=dm" (exc)); + err = HURD_DPORT_USE (fd, _hurd_xattr_remove (port, name)); - return (exc >> 6) & FE_ALL_EXCEPT; + return err ? __hurd_dfail (fd, err) : 0; } diff --git a/sysdeps/hppa/jmpbuf-unwind.h b/sysdeps/mach/hurd/fsetxattr.c index 6ea1876e19..db8b676a06 100644 --- a/sysdeps/hppa/jmpbuf-unwind.h +++ b/sysdeps/mach/hurd/fsetxattr.c @@ -1,4 +1,4 @@ -/* Examine __jmp_buf for unwinding frames. HPPA version. +/* Access to extended attributes on files. Hurd version. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,11 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <setjmp.h> -#include <jmpbuf-offsets.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <hurd/fd.h> -/* Test if longjmp to JMPBUF would unwind the frame containing a local - variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ - ((void *) (_address) > \ - (void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP]))) +ssize_t +fsetxattr (int fd, const char *name, const void *value, size_t size, int flags) +{ + error_t err; + + err = HURD_DPORT_USE (fd, _hurd_xattr_set (port, name, value, size, flags)); + + return err ? __hurd_dfail (fd, err) : 0; +} diff --git a/sysdeps/mach/hurd/getresgid.c b/sysdeps/mach/hurd/getresgid.c index a96aa49369..7847d213c4 100644 --- a/sysdeps/mach/hurd/getresgid.c +++ b/sysdeps/mach/hurd/getresgid.c @@ -1,5 +1,5 @@ -/* getresgid -- fetch effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* getresgid -- fetch real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,13 +22,13 @@ #include <hurd.h> #include <hurd/id.h> -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ int -__getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) +__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) { error_t err; - gid_t eff, real, saved; + gid_t real, eff, saved; HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_id.lock); @@ -42,8 +42,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) else { real = _hurd_id.aux.gids[0]; - saved = _hurd_id.aux.ngids < 2 ? real :_hurd_id.aux.gids[1]; eff = _hurd_id.gen.ngids < 1 ? real : _hurd_id.gen.gids[0]; + saved = _hurd_id.aux.ngids < 2 ? real : _hurd_id.aux.gids[1]; } } @@ -53,8 +53,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) if (err) return __hurd_fail (err); - *egid = eff; *rgid = real; + *egid = eff; *sgid = saved; return 0; } diff --git a/sysdeps/mach/hurd/getresuid.c b/sysdeps/mach/hurd/getresuid.c index f4bfaeaf56..668e463a39 100644 --- a/sysdeps/mach/hurd/getresuid.c +++ b/sysdeps/mach/hurd/getresuid.c @@ -1,5 +1,5 @@ -/* getresuid -- fetch effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* getresuid -- fetch real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,13 +22,13 @@ #include <hurd.h> #include <hurd/id.h> -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ int -__getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) +__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { error_t err; - uid_t eff, real, saved; + uid_t real, eff, saved; HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_id.lock); @@ -42,8 +42,8 @@ __getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) else { real = _hurd_id.aux.uids[0]; - saved = _hurd_id.aux.nuids < 2 ? real :_hurd_id.aux.uids[1]; eff = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0]; + saved = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1]; } } @@ -53,8 +53,8 @@ __getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) if (err) return __hurd_fail (err); - *euid = eff; *ruid = real; + *euid = eff; *suid = saved; return 0; } diff --git a/sysdeps/mach/hurd/getsid.c b/sysdeps/mach/hurd/getsid.c index 57c10c58b7..9dcfa90fde 100644 --- a/sysdeps/mach/hurd/getsid.c +++ b/sysdeps/mach/hurd/getsid.c @@ -28,6 +28,9 @@ getsid (pid_t pid) error_t err; pid_t sid; + if (pid == 0) + pid = _hurd_pid; + err = __USEPORT (PROC, __proc_getsid (port, pid, &sid)); if (err) return (pid_t) __hurd_fail (err); diff --git a/sysdeps/unix/sysv/linux/mips/ustat.c b/sysdeps/mach/hurd/getxattr.c index a309f7104c..8f688a1d2f 100644 --- a/sysdeps/unix/sysv/linux/mips/ustat.c +++ b/sysdeps/mach/hurd/getxattr.c @@ -1,6 +1,6 @@ -/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,20 +18,18 @@ 02111-1307 USA. */ #include <errno.h> -#include <sys/ustat.h> -#include <sys/sysmacros.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -int -ustat (dev_t dev, struct ustat *ubuf) +ssize_t +getxattr (const char *path, const char *name, void *value, size_t size) { - unsigned long k_dev; - - /* We must convert the value to dev_t type used by the kernel. */ - k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); - - return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf)); + error_t err; + file_t port = __file_name_lookup (path, 0, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_get (port, name, value, &size); + __mach_port_deallocate (__mach_task_self (), port); + return err ? __hurd_fail (err) : size; } diff --git a/sysdeps/mach/hurd/hppa/bits/sigcontext.h b/sysdeps/mach/hurd/hppa/bits/sigcontext.h deleted file mode 100644 index 5db43fc22c..0000000000 --- a/sysdeps/mach/hurd/hppa/bits/sigcontext.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. HPPA version. - Copyright (C) 1995,97,2001 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 _SIGNAL_H && !defined _SYS_UCONTEXT_H -# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." -#endif - -#ifndef sc_parisc_thread_state - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to a `struct - parisc_thread_state'. trampoline.c knows this, so it must be - changed if this changes. */ - -#define sc_parisc_thread_state sc_flags /* Beginning of correspondence. */ - /* "General" registers $1..$31. */ - unsigned int sc_regs[31]; - - /* Control registers. */ - unsigned int sc_cr11; /* sar */ - /* These four registers make up the PC. */ - unsigned int iioq_head; - unsigned int iisq_head; - unsigned int iioq_tail; - unsigned int iisq_tail; - unsigned int sc_cr15; - unsigned int sc_cr19; - unsigned int sc_cr20; - unsigned int sc_cr21; - unsigned int sc_cr22; /* ipsw */ - unsigned int sc_bsd_goto; /* unused */ - unsigned int sc_sr4; - unsigned int sc_sr0; - unsigned int sc_sr1; - unsigned int sc_sr2; - unsigned int sc_sr3; - unsigned int sc_sr5; - unsigned int sc_sr6; - unsigned int sc_sr7; - unsigned int sc_cr0; - unsigned int sc_cr8; - unsigned int sc_cr9; - unsigned int sc_cr10; /* unused */ - unsigned int sc_cr12; - unsigned int sc_cr13; - unsigned int sc_cr24; /* unused */ - unsigned int sc_cr25; /* unused */ - unsigned int sc_cr26; /* unused */ - unsigned sc_mpsfu_high; /* unused */ - unsigned sc_mpsfu_low; /* unused */ - unsigned sc_mpsfu_ovflo; /* unused */ - int sc_pad; - - /* Floating point registers $f0..$f31. */ - double sc_fpregs[32]; - }; - -#endif /* sc_parisc_thread_state */ diff --git a/sysdeps/mach/hurd/hppa/trampoline.c b/sysdeps/mach/hurd/hppa/trampoline.c deleted file mode 100644 index fc811c5e7b..0000000000 --- a/sysdeps/mach/hurd/hppa/trampoline.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Set thread_state for sighandler, and sigcontext to recover. HPPA version. - Copyright (C) 1995, 1997, 1998, 2005 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 <hurd/signal.h> -#include <thread_state.h> -#include <assert.h> -#include <errno.h> -#include "hurdfault.h" - - -struct mach_msg_trap_regargs - { - /* These first four arguments are in registers 26..23. */ - mach_msg_size_t rcv_size; /* arg3 */ - mach_msg_size_t send_size; /* arg2 */ - mach_msg_option_t option; /* arg1 */ - mach_msg_header_t *msg; /* arg0 */ - }; - -struct sigcontext * -_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, - int signo, long int sigcode, - volatile int rpc_wait, - struct machine_thread_all_state *state) -{ - __label__ trampoline, rpc_wait_trampoline; - void *volatile sigsp; - struct sigcontext *scp; - - if (ss->context) - { - /* We have a previous sigcontext that sigreturn was about - to restore when another signal arrived. We will just base - our setup on that. */ - if (_hurdsig_catch_fault (SIGSEGV)) - assert (_hurdsig_fault_sigcode >= (long int) ss->context && - _hurdsig_fault_sigcode < (long int) (ss->context + 1)); - else - { - memcpy (&state->basic, &ss->context->sc_parisc_thread_state, - sizeof (state->basic)); - state->set = (1 << PARISC_THREAD_STATE); - assert (! rpc_wait); - /* The intr_port slot was cleared before sigreturn sent us the - sig_post that made us notice this pending signal, so - _hurd_internal_post_signal wouldn't do interrupt_operation. - After we return, our caller will set SCP->sc_intr_port (in the - new context) from SS->intr_port and clear SS->intr_port. Now - that we are restoring this old context recorded by sigreturn, - we want to restore its intr_port too; so store it in - SS->intr_port now, so it will end up in SCP->sc_intr_port - later. */ - ss->intr_port = ss->context->sc_intr_port; - } - /* If the sigreturn context was bogus, just ignore it. */ - ss->context = NULL; - } - else if (! machine_get_basic_state (ss->thread, state)) - return NULL; - - if ((ss->actions[signo].sa_flags & SA_ONSTACK) && - !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) - { - sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size; - ss->sigaltstack.ss_flags |= SS_ONSTACK; - /* XXX need to set up base of new stack for - per-thread variables, cthreads. */ - } - else - sigsp = (char *) state->basic.uesp; - - /* Push the signal context on the stack. */ - sigsp -= sizeof (*scp); - scp = sigsp; - - if (_hurdsig_catch_fault (SIGSEGV)) - { - assert (_hurdsig_fault_sigcode >= (long int) scp && - _hurdsig_fault_sigcode <= (long int) (scp + 1)); - /* We got a fault trying to write the stack frame. - We cannot set up the signal handler. - Returning NULL tells our caller, who will nuke us with a SIGILL. */ - return NULL; - } - else - { - int ok; - - /* Set up the sigcontext from the current state of the thread. */ - - scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0; - - /* struct sigcontext is laid out so that starting at sc_regs mimics a - struct parisc_thread_state. */ - memcpy (&scp->sc_parisc_thread_state, - &state->basic, sizeof (state->basic)); - - _hurdsig_end_catch_fault (); - - if (! ok) - return NULL; - } - - /* Modify the thread state to call the trampoline code on the new stack. */ - if (rpc_wait) - { - /* The signalee thread was blocked in a mach_msg_trap system call, - still waiting for a reply. We will have it run the special - trampoline code which retries the message receive before running - the signal handler. - - To do this we change the OPTION argument on its stack to enable only - message reception, since the request message has already been - sent. */ - - struct mach_msg_trap_regargs *args = (void *) &state->basic.r23; - - if (_hurdsig_catch_fault (SIGSEGV)) - { - assert (_hurdsig_fault_sigcode >= (long int) args && - _hurdsig_fault_sigcode < (long int) (args + 1)); - /* Faulted accessing ARGS. Bomb. */ - return NULL; - } - - assert (args->option & MACH_RCV_MSG); - /* Disable the message-send, since it has already completed. The - calls we retry need only wait to receive the reply message. */ - args->option &= ~MACH_SEND_MSG; - - /* Limit the time to receive the reply message, in case the server - claimed that `interrupt_operation' succeeded but in fact the RPC - is hung. */ - args->option |= MACH_RCV_TIMEOUT; - args->timeout = _hurd_interrupted_rpc_timeout; - - _hurdsig_end_catch_fault (); - - MACHINE_THREAD_STATE_SET_PC (&state->basic, &&rpc_wait_trampoline); - /* The reply-receiving trampoline code runs initially on the original - user stack. We pass it the signal stack pointer in %r5. */ - state->basic.r5 = (int) sigsp; - /* After doing the message receive, the trampoline code will need to - update the %r28 value to be restored by sigreturn. To simplify - the assembly code, we pass the address of its slot in SCP to the - trampoline code in %r4. */ - state->basic.r4 = (unsigned int) &scp->sc_regs[27]; - /* Set up the arguments for the handler function in callee-saved - registers that we will move to the argument registers after - mach_msg_trap returns. */ - state->basic.r6 = signo; - state->basic.r7 = sigcode; - state->basic.r8 = (unsigned int) scp; - } - else - { - MACHINE_THREAD_STATE_SET_PC (&state->basic, &&trampoline); - state->basic.r20 = (unsigned int) sigsp; - /* Set up the arguments for the handler function. */ - state->basic.r26 = signo; - state->basic.r25 = sigcode; - state->basic.r24 = (unsigned int) scp; - } - - /* We pass the handler function to the trampoline code in %r9. */ - state->basic.r9 = (unsigned int) handler; - /* For convenience, we pass the address of __sigreturn in %r10. */ - state->basic.r10 = (unsigned int) &__sigreturn; - /* The extra copy of SCP for the __sigreturn arg goes in %r8. */ - state->basic.r10 = (unsigned int) scp; - - return scp; - - /* The trampoline code follows. This is not actually executed as part of - this function, it is just convenient to write it that way. */ - - rpc_wait_trampoline: - /* This is the entry point when we have an RPC reply message to receive - before running the handler. The MACH_MSG_SEND bit has already been - cleared in the OPTION argument on our stack. The interrupted user - stack pointer has not been changed, so the system call can find its - arguments; the signal stack pointer is in %ebx. For our convenience, - %ecx points to the sc_eax member of the sigcontext. */ - asm volatile - (/* Retry the interrupted mach_msg system call. */ - "ldil L%0xC0000000,%r1\nble 4(%sr7,%r1)\n" - "ldi -25, %r22\n" /* mach_msg_trap */ - /* When the sigcontext was saved, %r28 was MACH_RCV_INTERRUPTED. But - now the message receive has completed and the original caller of - the RPC (i.e. the code running when the signal arrived) needs to - see the final return value of the message receive in %r28. So - store the new %r28 value into the sc_regs[27] member of the sigcontext - (whose address is in %r4 to make this code simpler). */ - "stw (%r4), %r28\n" - /* Switch to the signal stack. */ - "copy %r5, %r30\n" - /* Copy the handler arguments to the argument registers. */ - "copy %r6, %r26\n" - "copy %r7, %r25\n" - "copy %r8, %r24\n" - ); - - trampoline: - /* Entry point for running the handler normally. The arguments to the - handler function are already in the argument registers. */ - asm volatile - ("bv (%r9); nop" /* Call the handler function. */ - "bv (%r10)\n" /* Call __sigreturn (SCP); never returns. */ - "copy %r8, %r26" /* Set up arg in delay slot. */ - : : "i" (&__sigreturn)); - - /* NOTREACHED */ - return NULL; -} diff --git a/bare/brdinit.c b/sysdeps/mach/hurd/lgetxattr.c index af96bcd12a..5ab591575e 100644 --- a/bare/brdinit.c +++ b/sysdeps/mach/hurd/lgetxattr.c @@ -1,7 +1,6 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), - On-Line Applications Research Corporation. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,15 +17,20 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <standalone.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <fcntl.h> -/* This file is only required when a "bare" board is configured. */ - -/* _Board_Initialize - -This routine normally performs board specific initialization. */ - -void -_Board_Initialize () +ssize_t +lgetxattr (const char *path, const char *name, void *value, size_t size) { + error_t err; + file_t port = __file_name_lookup (path, O_NOLINK, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_get (port, name, value, &size); + __mach_port_deallocate (__mach_task_self (), port); + return err ? __hurd_fail (err) : size; } diff --git a/sysdeps/mips/libc-tls.c b/sysdeps/mach/hurd/listxattr.c index a3d6301d1d..5f84e88316 100644 --- a/sysdeps/mips/libc-tls.c +++ b/sysdeps/mach/hurd/listxattr.c @@ -1,4 +1,4 @@ -/* Thread-local storage handling in the ELF dynamic linker. MIPS version. +/* Access to extended attributes on files. Hurd version. Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,21 +17,19 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <csu/libc-tls.c> -#include <dl-tls.h> +#include <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> -#if USE_TLS - -/* On MIPS, linker optimizations are not required, so __tls_get_addr - can be called even in statically linked binaries. In this case module - must be always 1 and PT_TLS segment exist in the binary, otherwise it - would not link. */ - -void * -__tls_get_addr (tls_index *ti) +ssize_t +listxattr (const char *path, char *list, size_t size) { - dtv_t *dtv = THREAD_DTV (); - return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET; + error_t err; + file_t port = __file_name_lookup (path, 0, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_list (port, list, &size); + __mach_port_deallocate (__mach_task_self (), port); + return err ? __hurd_fail (err) : size; } - -#endif diff --git a/sysdeps/mach/hurd/lsetxattr.c b/sysdeps/mach/hurd/lsetxattr.c new file mode 100644 index 0000000000..c2eae40e3a --- /dev/null +++ b/sysdeps/mach/hurd/lsetxattr.c @@ -0,0 +1,37 @@ +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2004 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 <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> +#include <fcntl.h> + +ssize_t +lsetxattr (const char *path, const char *name, const void *value, size_t size, + int flags) +{ + error_t err; + file_t port = __file_name_lookup (path, O_NOLINK, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_set (port, name, value, size, flags); + __mach_port_deallocate (__mach_task_self (), port); + return err ? __hurd_fail (err) : size; +} diff --git a/sysdeps/mach/hurd/mips/bits/sigcontext.h b/sysdeps/mach/hurd/mips/bits/sigcontext.h deleted file mode 100644 index 14c618857e..0000000000 --- a/sysdeps/mach/hurd/mips/bits/sigcontext.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. MIPS version. - Copyright (C) 1994,97,2001 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 _SIGNAL_H && !defined _SYS_UCONTEXT_H -# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." -#endif - -#ifndef sc_mips_thread_state - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to: - { - struct mips_thread_state ts; - struct mips_exc_state es; - struct mips_float_state fs; - } - trampoline.c knows this, so it must be changed if this changes. */ -#define sc_mips_thread_state sc_gpr /* Beginning of correspondence. */ - int sc_gpr[31]; /* "General" registers; [0] is r1. */ - int sc_mdlo, sc_mdhi; /* Low and high multiplication results. */ - int sc_pc; /* Instruction pointer. */ - - /* struct mips_exc_state */ -#define sc_mips_exc_state sc_cause - unsigned int sc_cause; /* Machine-level trap code. */ -#define SC_CAUSE_SST 0x00000044 - unsigned int sc_badvaddr; - unsigned int sc_coproc_used; /* Which coprocessors the thread has used. */ -#define SC_COPROC_USE_COP0 1 /* (by definition) */ -#define SC_COPROC_USE_COP1 2 /* FPA */ -#define SC_COPROC_USE_FPU SC_COPROC_USE_COP1 -#define SC_COPROC_USE_COP2 4 -#define SC_COPROC_USE_COP3 8 - - /* struct mips_float_state - This is only filled in if the SC_COPROC_USE_FPU bit - is set in sc_coproc_used. */ -#define sc_mips_float_state sc_fpr - int sc_fpr[32]; /* FP registers. */ - int sc_fpcsr; /* FPU status register. */ - int sc_fpeir; /* FP exception instruction register. */ - }; - -#endif /* sc_mips_thread_state */ diff --git a/sysdeps/mach/hurd/mips/dl-machine.c b/sysdeps/mach/hurd/mips/dl-machine.c deleted file mode 100644 index ce2d5db510..0000000000 --- a/sysdeps/mach/hurd/mips/dl-machine.c +++ /dev/null @@ -1,132 +0,0 @@ -/* Operating system support for run-time dynamic linker. MIPS specific - stuffs on Hurd. - Copyright (C) 1996, 1997 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 <hurd.h> -#include <link.h> -#include <unistd.h> -#include <fcntl.h> -#include <stdlib.h> -#include <sys/mman.h> -#include <assert.h> -#include <sysdep.h> -#include <mach/mig_support.h> -#include "../stdio-common/_itoa.h" -#include <stdarg.h> -#include <ctype.h> -#include <sys/stat.h> -#include <libintl.h> - -void weak_function -abort (void) -{ - _exit (127); -} - - -#include <string.h> -#include <mach/error.h> -#include <errorlib.h> - -#undef _ -#define _(x) x - -/* Return a string describing the errno code in ERRNUM. */ -char * weak_function -_strerror_internal (int errnum, char *buf, size_t buflen) -{ - int system; - int sub; - int code; - const struct error_system *es; - extern void __mach_error_map_compat (int *); - - __mach_error_map_compat (&errnum); - - system = err_get_system (errnum); - sub = err_get_sub (errnum); - code = err_get_code (errnum); - - if (system > err_max_system || ! __mach_error_systems[system].bad_sub) - { - const char *unk = _("Error in unknown error system: "); - const size_t unklen = strlen (unk); - char *p = buf + buflen; - *--p = '\0'; - p = _itoa (errnum, p, 16, 1); - return memcpy (p - unklen, unk, unklen); - } - - es = &__mach_error_systems[system]; - - if (sub >= es->max_sub) - return (char *) es->bad_sub; - - if (code >= es->subsystem[sub].max_code) - { - const char *unk = _("Unknown error "); - const size_t unklen = strlen (unk); - char *p = buf + buflen; - size_t len = strlen (es->subsystem[sub].subsys_name); - *--p = '\0'; - p = _itoa (errnum, p, 16, 1); - *p-- = ' '; - p = memcpy (p - len, es->subsystem[sub].subsys_name, len); - return memcpy (p - unklen, unk, unklen); - } - - return (char *) _(es->subsystem[sub].codes[code]); -} - -/* Read the whole contents of FILE into new mmap'd space with given - protections. The size of the file is returned in SIZE. */ -void * -_dl_sysdep_read_whole_file (const char *file, size_t *size, int prot) -{ - struct stat stat; - mach_port_t memobj_rd; - void *contents; - error_t err; - - memobj_rd = __open (file, O_RDONLY, 0); - if (memobj_rd) - { - err = __io_stat ((file_t) memobj_rd, &stat); - if (err) - { - __hurd_fail (err); - contents = 0; - } - else - { - /* Map a copy of the file contents. */ - contents = __mmap (0, stat.st_size, prot, MAP_COPY, memobj_rd, 0); - if (contents == (void *)-1) - contents = 0; - else - *size = stat.st_size; - } - - __mach_port_deallocate (__mach_task_self (), memobj_rd); - } - else - contents = 0; - - return contents; -} diff --git a/sysdeps/mach/hurd/mips/exc2signal.c b/sysdeps/mach/hurd/mips/exc2signal.c deleted file mode 100644 index c505ae5b22..0000000000 --- a/sysdeps/mach/hurd/mips/exc2signal.c +++ /dev/null @@ -1,97 +0,0 @@ -/* Translate Mach exception codes into signal numbers. MIPS version. - Copyright (C) 1996, 1997 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 <hurd.h> -#include <hurd/signal.h> -#include <mach/exception.h> - -/* Translate the Mach exception codes, as received in an `exception_raise' RPC, - into a signal number and signal subcode. */ - -void -_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo) -{ - detail->error = 0; - - switch (detail->exc) - { - default: - *signo = SIGIOT; - detail->code = detail->exc; - break; - - case EXC_BAD_ACCESS: - if (detail->exc_code == KERN_PROTECTION_FAILURE) - *signo = SIGSEGV; - else - *signo = SIGBUS; - detail->code = detail->exc_subcode; - detail->error = detail->exc_code; - break; - - case EXC_BAD_INSTRUCTION: - *signo = SIGILL; - if (detail->exc_code == EXC_MIPS_II) - detail->code = detail->exc_subcode; - else - detail->code = 0; - break; - - case EXC_ARITHMETIC: - switch (detail->exc_code) - { - case EXC_MIPS_OV: /* integer overflow */ - *signo = SIGFPE; - detail->code = detail->exc_subcode; - break; - - default: - *signo = SIGFPE; - detail->code = 0; - break; - - case EXC_MIPS_INT: - /* Subcode is the fp_status word saved by the hardware. - Give an error code corresponding to the first bit set. */ - if (detail->exc_subcode == EXC_MIPS_FLT_UNIMP) - *signo = SIGILL; - else - *signo = SIGFPE; - detail->code = detail->exc_subcode; - break; - } - break; - - case EXC_EMULATION: - /* 3.0 doesn't give this one, why, I don't know. */ - *signo = SIGEMT; - detail->code = 0; - break; - - case EXC_SOFTWARE: - *signo = SIGEMT; - detail->code = 0; - break; - - case EXC_BREAKPOINT: - *signo = SIGTRAP; - detail->code = 0; - break; - } -} diff --git a/sysdeps/mach/hurd/mips/init-fault.c b/sysdeps/mach/hurd/mips/init-fault.c deleted file mode 100644 index 05f48a3a56..0000000000 --- a/sysdeps/mach/hurd/mips/init-fault.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Set up a thread_state for proc_handle_exceptions. MIPS version. - Copyright (C) 1996, 1997 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 <hurd/signal.h> -#include <mach/thread_status.h> -#include <string.h> -#include <setjmp.h> - -extern jmp_buf _hurd_sigthread_fault_env; - -static char fault_stack[32]; -static volatile void -faulted (void) -{ - __longjmp (_hurd_sigthread_fault_env, 1); -} - -void -_hurd_initialize_fault_recovery_state (void *state) -{ - struct mips_thread_state *ts = state; - memset (ts, 0, sizeof (*ts)); - ts->r29 = (int) &fault_stack[sizeof (fault_stack)]; - ts->pc = (int) &faulted; -} diff --git a/sysdeps/mach/hurd/mips/init-first.c b/sysdeps/mach/hurd/mips/init-first.c deleted file mode 100644 index 6f53e839b3..0000000000 --- a/sysdeps/mach/hurd/mips/init-first.c +++ /dev/null @@ -1,414 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. For Mips/Hurd. - Copyright (C) 1996,1997,1998,2000,01,02,03 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 <hurd.h> -#include <stdio.h> -#include <unistd.h> -#include <string.h> -#include "hurdstartup.h" -#include "set-hooks.h" -#include "hurdmalloc.h" /* XXX */ - -extern void __mach_init (void); -extern void __init_misc (int, char **, char **); -#ifdef USE_NONOPTION_FLAGS -extern void __getopt_clean_environment (char **); -#endif -#ifndef SHARED -extern void _dl_non_dynamic_init (void) internal_function; -#endif -extern void __libc_global_ctors (void); - -unsigned int __hurd_threadvar_max; -unsigned long int __hurd_threadvar_stack_offset; -unsigned long int __hurd_threadvar_stack_mask; - -int __libc_multiple_libcs attribute_hidden = 1; - -int __libc_argc attribute_hidden; -char **__libc_argv attribute_hidden; - -void *(*_cthread_init_routine) (void); /* Returns new SP to use. */ -void (*_cthread_exit_routine) (int status) __attribute__ ((__noreturn__)); - - -/* Things that want to be run before _hurd_init or much anything else. - Importantly, these are called before anything tries to use malloc. */ -DEFINE_HOOK (_hurd_preinit_hook, (void)); - -static void -init1 (int argc, char *arg0, ...) -{ - char **argv = &arg0; - char **envp = &argv[argc + 1]; - struct hurd_startup_data *d; - - __libc_argc = argc; - __libc_argv = argv; - __environ = envp; - while (*envp) - ++envp; - d = (void *) ++envp; - - /* If we are the bootstrap task started by the kernel, - then after the environment pointers there is no Hurd - data block; the argument strings start there. */ - if ((void *) d != argv[0]) - { - _hurd_init_dtable = d->dtable; - _hurd_init_dtablesize = d->dtablesize; - - { - /* Check if the stack we are now on is different from - the one described by _hurd_stack_{base,size}. */ - - char dummy; - const vm_address_t newsp = (vm_address_t) &dummy; - - if (d->stack_size != 0 && (newsp < d->stack_base || - newsp - d->stack_base > d->stack_size)) - /* The new stack pointer does not intersect with the - stack the exec server set up for us, so free that stack. */ - __vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size); - } - } - - if (__hurd_threadvar_stack_mask == 0) - { - /* We are not using cthreads, so we will have just a single allocated - area for the per-thread variables of the main user thread. */ - unsigned long int i; - __hurd_threadvar_stack_offset - = (unsigned long int) malloc (__hurd_threadvar_max * - sizeof (unsigned long int)); - if (__hurd_threadvar_stack_offset == 0) - __libc_fatal ("Can't allocate single-threaded per-thread variables."); - for (i = 0; i < __hurd_threadvar_max; ++i) - ((unsigned long int *) __hurd_threadvar_stack_offset)[i] = 0; - } - - if ((void *) d != argv[0] && (d->portarray || d->intarray)) - /* Initialize library data structures, start signal processing, etc. */ - _hurd_init (d->flags, argv, - d->portarray, d->portarraysize, - d->intarray, d->intarraysize); - -#ifndef SHARED - _dl_non_dynamic_init (); -#endif - __init_misc (argc, argv, __environ); - -#ifdef USE_NONOPTION_FLAGS - /* This is a hack to make the special getopt in GNU libc working. */ - __getopt_clean_environment (envp); -#endif - -#ifdef SHARED - __libc_global_ctors (); -#endif - - (void) &init1; -} - -static void * -__init (int *data) -{ - int argc = *data; - char **argv = (void *) (data + 1); - char **envp = &argv[argc + 1]; - struct hurd_startup_data *d; - - __environ = envp; - while (*envp) - ++envp; - d = (void *) ++envp; - - /* The user might have defined a value for this, to get more variables. - Otherwise it will be zero on startup. We must make sure it is set - properly before before cthreads initialization, so cthreads can know - how much space to leave for thread variables. */ - if (__hurd_threadvar_max < _HURD_THREADVAR_MAX) - __hurd_threadvar_max = _HURD_THREADVAR_MAX; - - - /* After possibly switching stacks, call `init1' (above) with the user - code as the return address, and the argument data immediately above - that on the stack. */ - - if (_cthread_init_routine) - { - /* Initialize cthreads, which will allocate us a new stack to run on. */ - void *newsp = (*_cthread_init_routine) (); - struct hurd_startup_data *od; - - /* Copy the argdata from the old stack to the new one. */ - newsp = memcpy (newsp - ((char *) &d[1] - (char *) data), data, - (char *) d - (char *) data); - - /* Set up the Hurd startup data block immediately following - the argument and environment pointers on the new stack. */ - od = (newsp + ((char *) d - (char *) data)); - if ((void *) argv[0] == d) - /* We were started up by the kernel with arguments on the stack. - There is no Hurd startup data, so zero the block. */ - memset (od, 0, sizeof *od); - else - /* Copy the Hurd startup data block to the new stack. */ - *od = *d; - - /* Push the user code address on the top of the new stack. It will - be the return address for `init1'; we will jump there with NEWSP - as the stack pointer. */ - return newsp; - } - - /* The argument data is just above the stack frame we will unwind by - returning. */ - return (void *) data; - - (void) &__init; -} - -#ifdef SHARED -/* This function is called to initialize the shared C library. - It is called just before the user _start code from mips/elf/start.S, - with the stack set up as that code gets it. */ - -/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT - pointer in the dynamic section based solely on that. It is convention - for this function to be in the `.init' section, but the symbol name is - the only thing that really matters!! */ -/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ - -#if __mips64 -asm ("\ - .section .init,\"ax\",@progbits\n\ - .align 3\n\ - .globl _init\n\ - .type _init,@function\n\ - .ent _init\n\ -_init:\n\ - .set noreorder\n\ - .cpload $25\n\ - .set reorder\n\ - dsubu $29, 8*8\n\ - .cprestore 6*8\n\ - sd $16, 4*8($29)\n\ - sd $31, 5*8($29)\n\ - jal preinit\n\ - sd $28, 6*8($29)\n\ - move $16, $29 # Save the old stack pointer to s0 ($16)\n\ - daddu $4, $29, 4*8\n\ - jal __init\n\ - # Restore saved registers from the old stack.\n\ - ld $28, 6*8($16)\n\ - ld $31, 5*8($16)\n\ - ld $16, 4*8($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - dla $25, init1\n\ - jr $25\n\ - .end _init\n\ - .text\n\ -"); -#else -asm ("\ - .section .init,\"ax\",@progbits\n\ - .align 2\n\ - .globl _init\n\ - .type _init,@function\n\ - .ent _init\n\ -_init:\n\ - .set noreorder\n\ - .cpload $25\n\ - .set reorder\n\ - subu $29, 32\n\ - .cprestore 24\n\ - sw $16, 16($29)\n\ - sw $31, 20($29)\n\ - jal preinit\n\ - sw $28, 24($29)\n\ - move $16, $29 # Save the old stack pointer to s0 ($16)\n\ - addu $4, $29, 32\n\ - jal __init\n\ - # Restore saved registers from the old stack.\n\ - lw $28, 24($16)\n\ - lw $31, 20($16)\n\ - lw $16, 16($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - la $25, init1\n\ - jr $25\n\ - .end _init\n\ - .text\n\ -"); -#endif - -static void -preinit (void) -{ - /* Initialize data structures so we can do RPCs. */ - __mach_init (); - - RUN_HOOK (_hurd_preinit_hook, ()); - - (void) &preinit; -} - -void __libc_init_first (int argc, ...) -{ -} -#endif - -#ifndef SHARED -/* An assembler code wrapping c function __init. */ -#ifdef __mips64 -asm ("\ - .text\n\ - .align 3\n\ -init:\n\ - dsubu $29, 8*8\n\ - sd $16, 4*8($29)\n\ - sd $31, 5*8($29)\n\ - move $16, $29\n\ - jal __init\n\ - ld $31, 5*8($16)\n\ - ld $16, 4*8($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - dla $25, init1\n\ - jr $25\n\ -"); -#else -asm ("\ - .text\n\ - .align 2\n\ -init:\n\ - subu $29, 32\n\ - sw $16, 16($29)\n\ - sw $31, 20($29)\n\ - move $16, $29\n\ - jal __init\n\ - lw $31, 20($16)\n\ - lw $16, 16($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - la $25, init1\n\ - jr $25\n\ -"); -#endif - -/* An assembler code wrapping c function ___libc_init_first. - ___libc_init_first does an RPC call to flush cache to put doinit - function on the stack, so we should call __mach_init first in - this wrap. */ -#ifdef __mips64 -asm ("\ - .text\n\ - .align 3\n\ - .globl __libc_init_first\n\ -__libc_init_first:\n\ - dsubu $29, 8\n\ - sd $31, 0($29)\n\ - jal __mach_init\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - j ___libc_init_first\n\ -"); -#else -asm ("\ - .text\n\ - .align 2\n\ - .globl __libc_init_first\n\ -__libc_init_first:\n\ - subu $29, 4\n\ - sw $31, 0($29)\n\ - jal __mach_init\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - j ___libc_init_first\n\ -"); -#endif - -static void -___libc_init_first (int return_addr, int argc, ...) -{ - void doinit (int *data) - { -#if 0 - /* This function gets called with the argument data at TOS. */ - void doinit1 (int argc, ...) - { - init (&argc); - } -#endif - extern void init (int *data); - - /* Push the user return address after the argument data, and then - jump to `doinit1' (above), so it is as if __libc_init_first's - caller had called `init' with the argument data already on the - stack. */ - *--data = return_addr; - -#ifdef __mips64 - asm volatile ("ld $31, 0(%0)\n" /* Load the original return address. */ - "daddu $29, %0, 8\n" /* Switch to new outermost stack. */ - "move $4, $29\n" - "jr %1" : : "r" (data), "r" (&init)); -#else - asm volatile ("lw $31, 0(%0)\n" /* Load the original return address. */ - "addu $29, %0, 4\n" /* Switch to new outermost stack. */ - "move $4, $29\n" - "jr %1" : : "r" (data), "r" (&init)); -#endif - /* NOTREACHED */ - } - -#if 0 - /* Initialize data structures so we can do RPCs. */ - __mach_init (); -#endif - - RUN_HOOK (_hurd_preinit_hook, ()); - - _hurd_startup ((void **) &argc, &doinit); - - (void) &___libc_init_first; -} -#endif diff --git a/sysdeps/mach/hurd/mips/intr-msg.h b/sysdeps/mach/hurd/mips/intr-msg.h deleted file mode 100644 index 16c78972ac..0000000000 --- a/sysdeps/mach/hurd/mips/intr-msg.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Machine-dependent details of interruptible RPC messaging. Mips version. - Copyright (C) 1996, 1997 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. */ - - -#ifdef __mips64 -#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ -({ \ - error_t err; \ - mach_port_t __rcv_name = (rcv_name); \ - mach_msg_timeout_t __timeout = (timeout); \ - mach_port_t __notify = (notify); \ - asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ - ".globl _hurd_intr_rpc_msg_in_trap\n" \ - " move $4, %1\n" \ - " move $5, %2\n" \ - " move $6, %3\n" \ - " move $7, %4\n" \ - " move $8, %5\n" \ - " move $9, %6\n" \ - " move $10, %7\n" \ - " dli $2, -25\n" \ - "_hurd_intr_rpc_msg_do_trap: syscall\n" \ - "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ - : "=r" (err) \ - : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ - "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ - "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ - err; \ -}) -#else -#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ -({ \ - error_t err; \ - mach_port_t __rcv_name = (rcv_name); \ - mach_msg_timeout_t __timeout = (timeout); \ - mach_port_t __notify = (notify); \ - asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ - ".globl _hurd_intr_rpc_msg_in_trap\n" \ - " move $4, %1\n" \ - " move $5, %2\n" \ - " move $6, %3\n" \ - " move $7, %4\n" \ - " move $8, %5\n" \ - " move $9, %6\n" \ - " move $10, %7\n" \ - " li $2, -25\n" \ - "_hurd_intr_rpc_msg_do_trap: syscall\n" \ - "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ - : "=r" (err) \ - : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ - "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ - "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ - err; \ -}) -#endif - -static inline void -INTR_MSG_BACK_OUT (struct mips_thread_state *state) -{ - return; -} - -#include "hurdfault.h" - -static inline int -SYSCALL_EXAMINE (struct mips_thread_state *state, int *callno) -{ - u_int32_t *p = (void *) (state->pc - 4); - int result; - if (_hurdsig_catch_memory_fault (p)) - return 0; - if (result = (*p == 0x0000000c)) - /* The PC is just after a `syscall' instruction. - This is a system call in progress; v0($2) holds the call number. */ - *callno = state->r2; - _hurdsig_end_catch_fault (); - return result; -} - - -struct mach_msg_trap_args - { - /* This is the order of arguments to mach_msg_trap. */ - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t timeout; - mach_port_t notify; - }; - - -static inline mach_port_t -MSG_EXAMINE (struct mips_thread_state *state, int *msgid) -{ - mach_msg_header_t *msg; - mach_port_t send_port; - - msg = (mach_msg_header_t *) state->r4; - - if (_hurdsig_catch_memory_fault (msg)) - return MACH_PORT_NULL; - send_port = msg->msgh_remote_port; - *msgid = msg->msgh_id; - _hurdsig_end_catch_fault (); - - return send_port; -} diff --git a/sysdeps/mach/hurd/mips/longjmp-ctx.c b/sysdeps/mach/hurd/mips/longjmp-ctx.c deleted file mode 100644 index 66ee7b6fb8..0000000000 --- a/sysdeps/mach/hurd/mips/longjmp-ctx.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Perform a `longjmp' on a `struct sigcontext'. MIPS version. - Copyright (C) 1996, 1997 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 <setjmp.h> -#include <hurd/signal.h> -#include <string.h> - -void -_hurd_longjmp_sigcontext (struct sigcontext *scp, jmp_buf env, int retval) -{ - scp->sc_gpr[16] = env[0].__regs[0]; - scp->sc_gpr[17] = env[0].__regs[1]; - scp->sc_gpr[18] = env[0].__regs[2]; - scp->sc_gpr[19] = env[0].__regs[3]; - scp->sc_gpr[20] = env[0].__regs[4]; - scp->sc_gpr[21] = env[0].__regs[5]; - scp->sc_gpr[22] = env[0].__regs[6]; - scp->sc_gpr[23] = env[0].__regs[7]; - - scp->sc_gpr[28] = (int) env[0].__gp; - scp->sc_fp = (int) env[0].__fp; - scp->sc_sp = (int) env[0].__sp; - scp->sc_pc = (int) env[0].__pc; - scp->sc_gpr[2] = retval ?: 1; -} diff --git a/sysdeps/mach/hurd/mips/longjmp-ts.c b/sysdeps/mach/hurd/mips/longjmp-ts.c deleted file mode 100644 index 4c69e4e2b9..0000000000 --- a/sysdeps/mach/hurd/mips/longjmp-ts.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Perform a `longjmp' on a Mach thread_state. MIPS version. - Copyright (C) 1996, 1997 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 <hurd/signal.h> -#include <setjmp.h> -#include <mach/thread_status.h> - - -/* Set up STATE to do the equivalent of `longjmp (ENV, VAL);'. */ - -void -_hurd_longjmp_thread_state (void *state, jmp_buf env, int val) -{ - struct mips_thread_state *ts = state; - - ts->r16 = env[0].__jmpbuf[0].__regs[0]; - ts->r17 = env[0].__jmpbuf[0].__regs[1]; - ts->r18 = env[0].__jmpbuf[0].__regs[2]; - ts->r19 = env[0].__jmpbuf[0].__regs[3]; - ts->r20 = env[0].__jmpbuf[0].__regs[4]; - ts->r21 = env[0].__jmpbuf[0].__regs[5]; - ts->r22 = env[0].__jmpbuf[0].__regs[6]; - ts->r23 = env[0].__jmpbuf[0].__regs[7]; - ts->r28 = (int) env[0].__jmpbuf[0].__gp; - ts->r29 = (int) env[0].__jmpbuf[0].__sp; - ts->r30 = (int) env[0].__jmpbuf[0].__fp; - ts->pc = (int) env[0].__jmpbuf[0].__pc; - ts->r2 = val ?: 1; -} diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c deleted file mode 100644 index a9f7673eb5..0000000000 --- a/sysdeps/mach/hurd/mips/sigreturn.c +++ /dev/null @@ -1,223 +0,0 @@ -/* Copyright (C) 1996, 1997, 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 <hurd.h> -#include <hurd/signal.h> -#include <hurd/threadvar.h> -#include <stdlib.h> -#include <mach/mips/mips_instruction.h> - -int -__sigreturn (struct sigcontext *scp) -{ - struct hurd_sigstate *ss; - struct hurd_userlink *link = (void *) &scp[1]; - mach_port_t *reply_port; - - if (scp == NULL || (scp->sc_mask & _SIG_CANT_MASK)) - { - errno = EINVAL; - return -1; - } - - ss = _hurd_self_sigstate (); - __spin_lock (&ss->lock); - - /* Remove the link on the `active resources' chain added by - _hurd_setup_sighandler. Its purpose was to make sure - that we got called; now we have, it is done. */ - _hurd_userlink_unlink (link); - - /* Restore the set of blocked signals, and the intr_port slot. */ - ss->blocked = scp->sc_mask; - ss->intr_port = scp->sc_intr_port; - - /* Check for pending signals that were blocked by the old set. */ - if (ss->pending & ~ss->blocked) - { - /* There are pending signals that just became unblocked. Wake up the - signal thread to deliver them. But first, squirrel away SCP where - the signal thread will notice it if it runs another handler, and - arrange to have us called over again in the new reality. */ - ss->context = scp; - __spin_unlock (&ss->lock); - __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ()); - /* If a pending signal was handled, sig_post never returned. */ - __spin_lock (&ss->lock); - ss->context = NULL; - } - - if (scp->sc_onstack) - { - ss->sigaltstack.ss_flags &= ~SS_ONSTACK; /* XXX threadvars */ - /* XXX cannot unlock until off sigstack */ - abort (); - } - else - __spin_unlock (&ss->lock); - - /* Destroy the MiG reply port used by the signal handler, and restore the - reply port in use by the thread when interrupted. */ - reply_port = - (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY); - if (*reply_port) - { - mach_port_t port = *reply_port; - - /* Assigning MACH_PORT_DEAD here tells libc's mig_get_reply_port not to - get another reply port, but avoids mig_dealloc_reply_port trying to - deallocate it after the receive fails (which it will, because the - reply port will be bogus, whether we do this or not). */ - *reply_port = MACH_PORT_DEAD; - - __mach_port_destroy (__mach_task_self (), port); - } - *reply_port = scp->sc_reply_port; - - if (scp->sc_coproc_used & SC_COPROC_USE_FPU) - { - /* Restore FPU state. */ -#define restore_fpr(n) \ - asm volatile ("l.d $f" #n ",%0" : : "m" (scp->sc_fpr[n])) - - /* Restore floating-point registers. */ -#ifdef __mips64 - restore_fpr (0); - restore_fpr (1); - restore_fpr (2); - restore_fpr (3); - restore_fpr (4); - restore_fpr (5); - restore_fpr (6); - restore_fpr (7); - restore_fpr (8); - restore_fpr (9); - restore_fpr (10); - restore_fpr (11); - restore_fpr (12); - restore_fpr (13); - restore_fpr (14); - restore_fpr (15); - restore_fpr (16); - restore_fpr (17); - restore_fpr (18); - restore_fpr (19); - restore_fpr (20); - restore_fpr (21); - restore_fpr (22); - restore_fpr (23); - restore_fpr (24); - restore_fpr (25); - restore_fpr (26); - restore_fpr (27); - restore_fpr (28); - restore_fpr (29); - restore_fpr (30); - restore_fpr (31); -#else - restore_fpr (0); - restore_fpr (2); - restore_fpr (4); - restore_fpr (6); - restore_fpr (8); - restore_fpr (10); - restore_fpr (12); - restore_fpr (14); - restore_fpr (16); - restore_fpr (18); - restore_fpr (20); - restore_fpr (22); - restore_fpr (24); - restore_fpr (26); - restore_fpr (28); - restore_fpr (30); -#endif - - /* Restore the floating-point control/status register ($f31). */ - asm volatile ("ctc1 %0,$f31" : : "r" (scp->sc_fpcsr)); - } - - /* Load all the registers from the sigcontext. */ -#ifdef __mips64 -#define restore_gpr(n) \ - asm volatile ("ld $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) -#else -#define restore_gpr(n) \ - asm volatile ("lw $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) -#endif - - { - register const struct sigcontext *const scpreg asm ("$1") = scp; - register int *at asm ("$1"); - - /* First restore the multiplication result registers. The compiler - will use some temporary registers, so we do this before restoring - the general registers. */ - asm volatile ("mtlo %0" : : "r" (scpreg->sc_mdlo)); - asm volatile ("mthi %0" : : "r" (scpreg->sc_mdhi)); - - /* In the word after the saved PC, store the saved $1 value. */ - (&scpreg->sc_pc)[1] = scpreg->sc_gpr[0]; - - asm volatile (".set noreorder; .set noat;"); - - /* Restore the normal registers. */ - restore_gpr (2); - restore_gpr (3); - restore_gpr (4); - restore_gpr (5); - restore_gpr (6); - restore_gpr (7); - restore_gpr (8); - restore_gpr (9); - restore_gpr (10); - restore_gpr (11); - restore_gpr (12); - restore_gpr (13); - restore_gpr (14); - restore_gpr (15); - restore_gpr (16); - restore_gpr (17); - restore_gpr (18); - restore_gpr (19); - restore_gpr (20); - restore_gpr (21); - restore_gpr (22); - restore_gpr (23); - restore_gpr (24); - restore_gpr (25); - /* Registers 26-27 are kernel-only. */ - restore_gpr (28); - restore_gpr (29); /* Stack pointer. */ - restore_gpr (30); /* Frame pointer. */ - restore_gpr (31); /* Return address. */ - - at = &scpreg->sc_pc; - /* This is an emulated instruction that will find at the address in $1 - two words: the PC value to restore, and the $1 value to restore. */ - asm volatile (".word %0" : : "i" (op_sigreturn)); - asm volatile (".set reorder; .set at;"); - /* NOTREACHED */ - return at; /* To prevent optimization. */ - } - - /* NOTREACHED */ - return -1; -} - -weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/mach/hurd/mips/trampoline.c b/sysdeps/mach/hurd/mips/trampoline.c deleted file mode 100644 index 34e363b1aa..0000000000 --- a/sysdeps/mach/hurd/mips/trampoline.c +++ /dev/null @@ -1,292 +0,0 @@ -/* Set thread_state for sighandler, and sigcontext to recover. MIPS version. - Copyright (C) 1996, 1997, 1998, 2005 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 <hurd/signal.h> -#include <hurd/userlink.h> -#include <thread_state.h> -#include <assert.h> -#include <errno.h> -#include "hurdfault.h" -#include <intr-msg.h> - - -struct sigcontext * -_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, - int signo, struct hurd_signal_detail *detail, - volatile int rpc_wait, - struct machine_thread_all_state *state) -{ - __label__ trampoline, rpc_wait_trampoline, firewall; - void *volatile sigsp; - struct sigcontext *scp; - struct - { - int signo; - long int sigcode; - struct sigcontext *scp; /* Points to ctx, below. */ - void *sigreturn_addr; - void *sigreturn_returns_here; - struct sigcontext *return_scp; /* Same; arg to sigreturn. */ - struct sigcontext ctx; - struct hurd_userlink link; - } *stackframe; - - if (ss->context) - { - /* We have a previous sigcontext that sigreturn was about - to restore when another signal arrived. We will just base - our setup on that. */ - if (! _hurdsig_catch_memory_fault (ss->context)) - { - memcpy (&state->basic, &ss->context->sc_mips_thread_state, - sizeof (state->basic)); - memcpy (&state->exc, &ss->context->sc_mips_exc_state, - sizeof (state->exc)); - state->set = (1 << MIPS_THREAD_STATE) | (1 << MIPS_EXC_STATE); - if (state->exc.coproc_state & SC_COPROC_USE_FPU) - { - memcpy (&state->fpu, &ss->context->sc_mips_float_state, - sizeof (state->fpu)); - state->set |= (1 << MIPS_FLOAT_STATE); - } - } - } - - if (! machine_get_basic_state (ss->thread, state)) - return NULL; - - /* Save the original SP in the gratuitous s0 ($16) slot. - We may need to reset the SP (the `r29' slot) to avoid clobbering an - interrupted RPC frame. */ - state->basic.r16 = state->basic.r29; - - if ((ss->actions[signo].sa_flags & SA_ONSTACK) && - !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) - { - sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size; - ss->sigaltstack.ss_flags |= SS_ONSTACK; - /* XXX need to set up base of new stack for - per-thread variables, cthreads. */ - } - else - sigsp = (char *) state->basic.r29; - - /* Push the arguments to call `trampoline' on the stack. */ - sigsp -= sizeof (*stackframe); - stackframe = sigsp; - - if (_hurdsig_catch_memory_fault (stackframe)) - { - /* We got a fault trying to write the stack frame. - We cannot set up the signal handler. - Returning NULL tells our caller, who will nuke us with a SIGILL. */ - return NULL; - } - else - { - int ok; - - extern void _hurdsig_longjmp_from_handler (void *, jmp_buf, int); - - /* Add a link to the thread's active-resources list. We mark this as - the only user of the "resource", so the cleanup function will be - called by any longjmp which is unwinding past the signal frame. - The cleanup function (in sigunwind.c) will make sure that all the - appropriate cleanups done by sigreturn are taken care of. */ - stackframe->link.cleanup = &_hurdsig_longjmp_from_handler; - stackframe->link.cleanup_data = &stackframe->ctx; - stackframe->link.resource.next = NULL; - stackframe->link.resource.prevp = NULL; - stackframe->link.thread.next = ss->active_resources; - stackframe->link.thread.prevp = &ss->active_resources; - if (stackframe->link.thread.next) - stackframe->link.thread.next->thread.prevp - = &stackframe->link.thread.next; - ss->active_resources = &stackframe->link; - - /* Set up the arguments for the signal handler. */ - stackframe->signo = signo; - stackframe->sigcode = detail->code; - stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx; - stackframe->sigreturn_addr = &__sigreturn; - stackframe->sigreturn_returns_here = &&firewall; /* Crash on return. */ - - /* Set up the sigcontext from the current state of the thread. */ - - scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0; - - /* struct sigcontext is laid out so that starting at sc_gpr - mimics a struct mips_thread_state. */ - memcpy (&scp->sc_mips_thread_state, - &state->basic, sizeof (state->basic)); - - /* struct sigcontext is laid out so that starting at sc_cause - mimics a struct mips_exc_state. */ - ok = machine_get_state (ss->thread, state, MIPS_EXC_STATE, - &state->exc, &scp->sc_cause, - sizeof (state->exc)); - - if (ok && (scp->sc_coproc_used & SC_COPROC_USE_FPU)) - /* struct sigcontext is laid out so that starting at sc_fpr - mimics a struct mips_float_state. This state - is only meaningful if the coprocessor was used. */ - ok = machine_get_state (ss->thread, state, MIPS_FLOAT_STATE, - &state->fpu, &scp->sc_mips_float_state, - sizeof (state->fpu)); - - _hurdsig_end_catch_fault (); - - if (! ok) - return NULL; - } - - /* Modify the thread state to call the trampoline code on the new stack. */ - if (rpc_wait) - { - /* The signalee thread was blocked in a mach_msg_trap system call, - still waiting for a reply. We will have it run the special - trampoline code which retries the message receive before running - the signal handler. - - To do this we change the OPTION argument in its registers to - enable only message reception, since the request message has - already been sent. */ - - /* The system call arguments are stored in consecutive registers - starting with a0 ($4). */ - struct mach_msg_trap_args *args = (void *) &state->basic.r4; - - if (_hurdsig_catch_memory_fault (args)) - { - /* Faulted accessing ARGS. Bomb. */ - return NULL; - } - - assert (args->option & MACH_RCV_MSG); - /* Disable the message-send, since it has already completed. The - calls we retry need only wait to receive the reply message. */ - args->option &= ~MACH_SEND_MSG; - - /* Limit the time to receive the reply message, in case the server - claimed that `interrupt_operation' succeeded but in fact the RPC - is hung. */ - args->option |= MACH_RCV_TIMEOUT; - args->timeout = _hurd_interrupted_rpc_timeout; - - _hurdsig_end_catch_fault (); - - state->basic.pc = (int) &&rpc_wait_trampoline; - /* The reply-receiving trampoline code runs initially on the original - user stack. We pass it the signal stack pointer in s4 ($20). */ - state->basic.r29 = state->basic.r16; /* Restore mach_msg syscall SP. */ - state->basic.r20 = (int) sigsp; - /* After doing the message receive, the trampoline code will need to - update the v0 ($2) value to be restored by sigreturn. To simplify - the assembly code, we pass the address of its slot in SCP to the - trampoline code in s5 ($21). */ - state->basic.r21 = (int) &scp->sc_gpr[1]; - /* We must preserve the mach_msg_trap args in a0..t2 ($4..$10). - Pass the handler args to the trampoline code in s1..s3 ($17..$19). */ - state->basic.r17 = signo; - state->basic.r18 = detail->code; - state->basic.r19 = (int) scp; - } - else - { - state->basic.pc = (int) &&trampoline; - state->basic.r29 = (int) sigsp; - state->basic.r4 = signo; - state->basic.r5 = detail->code; - state->basic.r6 = (int) scp; - } - - /* We pass the handler function to the trampoline code in s6 ($22). */ - state->basic.r22 = (int) handler; - /* In the callee-saved register s0 ($16), we save the SCP value to pass - to __sigreturn after the handler returns. */ - state->basic.r16 = (int) scp; - - return scp; - - /* The trampoline code follows. This is not actually executed as part of - this function, it is just convenient to write it that way. */ - - rpc_wait_trampoline: - /* This is the entry point when we have an RPC reply message to receive - before running the handler. The MACH_MSG_SEND bit has already been - cleared in the OPTION argument in our registers. For our convenience, - $3 points to the sc_gpr[1] member of the sigcontext (saved v0 ($2)). */ - asm volatile - (".set noat; .set noreorder; .set nomacro\n" - /* Retry the interrupted mach_msg system call. */ -#ifdef __mips64 - "dli $2, -25\n" /* mach_msg_trap */ -#else - "li $2, -25\n" /* mach_msg_trap */ -#endif - "syscall\n" - /* When the sigcontext was saved, v0 was MACH_RCV_INTERRUPTED. But - now the message receive has completed and the original caller of - the RPC (i.e. the code running when the signal arrived) needs to - see the final return value of the message receive in v0. So - store the new v0 value into the sc_gpr[1] member of the sigcontext - (whose address is in s5 to make this code simpler). */ -#ifdef __mips64 - "sd $2, ($21)\n" -#else - "sw $2, ($21)\n" -#endif - /* Since the argument registers needed to have the mach_msg_trap - arguments, we've stored the arguments to the handler function - in registers s1..s3 ($17..$19). */ - "move $4, $17\n" - "move $5, $18\n" - "move $6, $19\n" - /* Switch to the signal stack. */ - "move $29, $20\n"); - - trampoline: - /* Entry point for running the handler normally. The arguments to the - handler function are already in the standard registers: - - a0 SIGNO - a1 SIGCODE - a2 SCP - */ - asm volatile - ("move $25, $22\n" /* Copy s6 to t9 for MIPS ABI. */ - "jal $25; nop\n" /* Call the handler function. */ - /* Call __sigreturn (SCP); this cannot return. */ -#ifdef __mips64 - "dla $1,%0\n" -#else - "la $1,%0\n" -#endif - "j $1\n" - "move $4, $16" /* Set up arg from saved SCP in delay slot. */ - : : "i" (&__sigreturn)); - - /* NOTREACHED */ - asm volatile (".set reorder; .set at; .set macro"); - - firewall: - asm volatile ("hlt: j hlt"); - - return NULL; -} diff --git a/sysdeps/unix/sysv/linux/hppa/brk.c b/sysdeps/mach/hurd/removexattr.c index a4b4df2831..bbfee3d304 100644 --- a/sysdeps/unix/sysv/linux/hppa/brk.c +++ b/sysdeps/mach/hurd/removexattr.c @@ -1,5 +1,5 @@ -/* brk system call for Linux/HPPA. - Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc. +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2005 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 @@ -18,25 +18,18 @@ 02111-1307 USA. */ #include <errno.h> -#include <unistd.h> -#include <sysdep.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -int -__brk (void *addr) +ssize_t +removexattr (const char *path, const char *name) { - void *newbrk; - - __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; + error_t err; + file_t port = __file_name_lookup (path, 0, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_remove (port, name); + __mach_port_deallocate (__mach_task_self (), port); + return __hurd_fail (err); } -weak_alias (__brk, brk) diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c index 5e3c7f0836..8fcf26eaf1 100644 --- a/sysdeps/mach/hurd/setresgid.c +++ b/sysdeps/mach/hurd/setresgid.c @@ -1,5 +1,5 @@ -/* setresgid -- set effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002, 2005 Free Software Foundation, Inc. +/* setresgid -- set real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,10 +22,10 @@ #include <hurd.h> #include <hurd/id.h> -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ int -__setresgid (gid_t egid, gid_t rgid, gid_t sgid) +__setresgid (gid_t rgid, gid_t egid, gid_t sgid) { auth_t newauth; error_t err; diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c index f9d76a95ca..ccf8d08d40 100644 --- a/sysdeps/mach/hurd/setresuid.c +++ b/sysdeps/mach/hurd/setresuid.c @@ -1,5 +1,5 @@ -/* setresuid -- set effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002, 2005 Free Software Foundation, Inc. +/* setresuid -- set real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,10 +22,10 @@ #include <hurd.h> #include <hurd/id.h> -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ int -__setresuid (uid_t euid, uid_t ruid, uid_t suid) +__setresuid (uid_t ruid, uid_t euid, uid_t suid) { auth_t newauth; error_t err; diff --git a/sysdeps/mach/hurd/setxattr.c b/sysdeps/mach/hurd/setxattr.c new file mode 100644 index 0000000000..afabc8ee06 --- /dev/null +++ b/sysdeps/mach/hurd/setxattr.c @@ -0,0 +1,36 @@ +/* Access to extended attributes on files. Hurd version. + Copyright (C) 2006 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 <errno.h> +#include <sys/xattr.h> +#include <hurd.h> +#include <hurd/xattr.h> + +ssize_t +setxattr (const char *path, const char *name, const void *value, size_t size, + int flags) +{ + error_t err; + file_t port = __file_name_lookup (path, 0, 0); + if (port == MACH_PORT_NULL) + return -1; + err = _hurd_xattr_set (port, name, value, size, flags); + __mach_port_deallocate (__mach_task_self (), port); + return __hurd_fail (err); +} diff --git a/sysdeps/mach/mips/Makefile b/sysdeps/mach/mips/Makefile deleted file mode 100644 index a890ae7b46..0000000000 --- a/sysdeps/mach/mips/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(subdir),gnulib) -sysdep_routines += cacheflush -endif diff --git a/sysdeps/mach/mips/cacheflush.c b/sysdeps/mach/mips/cacheflush.c deleted file mode 100644 index 2a283e3e89..0000000000 --- a/sysdeps/mach/mips/cacheflush.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Flush the insn cache after GCC writes a closure on the stack. Mach/MIPS. - Copyright (C) 1996, 1997 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 <mach.h> -#include <mach/vm_attributes.h> - -/* Stupid name, but this is what GCC generates (config/mips/mips.h). */ -void -cacheflush (void *addr, unsigned size, int flag) -{ - vm_machine_attribute_val_t val; - - switch (flag) - { - case 0: /* ? */ - val = MATTR_VAL_DCACHE_FLUSH; - case 1: /* This is the only value GCC uses. */ - val = MATTR_VAL_ICACHE_FLUSH; - break; - default: - val = MATTR_VAL_CACHE_FLUSH; - } - - __vm_machine_attribute (__mach_task_self (), - (vm_address_t) addr, size, - MATTR_CACHE, - &val); -} diff --git a/sysdeps/mach/mips/machine-lock.h b/sysdeps/mach/mips/machine-lock.h deleted file mode 100644 index eccc720dfa..0000000000 --- a/sysdeps/mach/mips/machine-lock.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Machine-specific definition for spin locks. MIPS version. - Copyright (C) 1996, 1997 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 _MACHINE_LOCK_H -#define _MACHINE_LOCK_H - -/* To get the TAS pseudo-instruction. */ -#include <mach/mips/mips_instruction.h> - -/* The type of a spin lock variable. */ - -typedef __volatile int __spin_lock_t; - -/* Value to initialize `__spin_lock_t' variables to. */ - -#define __SPIN_LOCK_INITIALIZER 0 - - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Unlock LOCK. */ - -_EXTERN_INLINE void -__spin_unlock (__spin_lock_t *__lock) -{ - *__lock = 0; -} - -/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */ - -_EXTERN_INLINE int -__spin_try_lock (register __spin_lock_t *__lock) -{ -#if (__mips >= 2) - int __rtn; - - __asm__ __volatile (".set noreorder"); -#if (__mips64) - __asm__ __volatile ("lld %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#else - __asm__ __volatile ("ll %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#endif - if (__rtn) - return 0; - __asm__ __volatile ("move %0,%1" : "=r" (__rtn) : "r" (__lock)); -#if (__mips64) - __asm__ __volatile ("scd %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#else - __asm__ __volatile ("sc %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#endif - __asm__ __volatile (".set reorder"); - return __rtn; -#else - register int __rtn __asm__ ("a0"); - - /* Use the Mach microkernel's emulated TAS pseudo-instruction. */ - __asm__ __volatile (".set noreorder"); - __asm__ __volatile (".word %1" : "=r" (__rtn) : "i" (op_tas), "0" (__lock)); - __asm__ __volatile ("nop"); - __asm__ __volatile (".set reorder"); - return __rtn ^ (int) __lock; -#endif -} - -/* Return nonzero if LOCK is locked. */ - -_EXTERN_INLINE int -__spin_lock_locked (__spin_lock_t *__lock) -{ - return *__lock != 0; -} - - -#endif /* machine-lock.h */ diff --git a/sysdeps/mach/mips/machine-sp.h b/sysdeps/mach/mips/machine-sp.h deleted file mode 100644 index 144356a39f..0000000000 --- a/sysdeps/mach/mips/machine-sp.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Machine-specific function to return the stack pointer. MIPS version. - Copyright (C) 1996, 1997 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 _MACHINE_SP_H -#define _MACHINE_SP_H - -/* Return the current stack pointer. */ - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -_EXTERN_INLINE void * -__thread_stack_pointer (void) -{ - void *__sp__; - __asm__ ("move %0,$29" : "=r" (__sp__)); - return __sp__; -} - -#endif /* machine-sp.h */ - diff --git a/sysdeps/mach/mips/syscall.S b/sysdeps/mach/mips/syscall.S deleted file mode 100644 index f2fc29df15..0000000000 --- a/sysdeps/mach/mips/syscall.S +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1996, 1997 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 <sysdep.h> - -#ifdef PIC - .option pic2 -#endif -ENTRY (syscall) - move v0, a0 /* Load system call number from first arg. */ - move a0, a1 /* Move the next three args up a register. */ - move a1, a2 - move a2, a3 - /* Load the remaining possible args (up to 11) from the stack. */ -#ifdef __mips64 - ld t0,4*8(sp) - ld t1,5*8(sp) - ld t2,6*8(sp) - ld t3,7*8(sp) - ld t4,8*8(sp) - ld t5,9*8(sp) - ld t6,10*8(sp) -#else - lw t0,4*4(sp) - lw t1,5*4(sp) - lw t2,6*4(sp) - lw t3,7*4(sp) - lw t4,8*4(sp) - lw t5,9*4(sp) - lw t6,10*4(sp) -#endif - syscall /* Do the system call. */ - j ra /* Return to caller. */ diff --git a/sysdeps/mach/mips/sysdep.h b/sysdeps/mach/mips/sysdep.h deleted file mode 100644 index 8136f95bf2..0000000000 --- a/sysdeps/mach/mips/sysdep.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 1996, 1997 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 LOSE asm volatile ("1: b 1b") - -#define START_MACHDEP asm ("\ - .text\n\ - .globl _start\n\ - .ent _start\n\ -_start:\n\ - # Put initial SP in a0.\n\ - move $4, $29\n\ - # Jump to _start0; don't return.\n\ - j _start0\n\ - .end _start\n\ -"); -#define START_ARGS int *entry_sp -#define SNARF_ARGS(argc, argv, envp) \ - do \ - { \ - register char **p; \ - \ - argc = *entry_sp; \ - argv = (char **) (entry_sp + 1); \ - p = argv; \ - while (*p++ != NULL) \ - ; \ - if (p >= (char **) argv[0]) \ - --p; \ - envp = p; \ - } while (0) - -#define CALL_WITH_SP(fn, sp) \ - ({ register int __fn = fn, __sp = (int) sp; \ - asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));}) - -#define RETURN_TO(sp, pc, retval) \ - asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \ - : : "r" (sp), "r" (pc), "r" (retval)) - -#define STACK_GROWTH_DOWN - -#include <syscall.h> - -#if defined (__ASSEMBLER__) - -#define ALIGN 2 - -#define MOVE(x,y) move y , x - -#define SYSCALL(name, args) \ - .globl syscall_error; \ - kernel_trap(name,SYS_##name,args); \ - beq $1,$0,1f; \ - j syscall_error; \ -1: - -#define SYSCALL__(name, args) \ - .globl syscall_error; \ - kernel_trap(__##name,SYS_##name,args); \ - beq $1,$0,1f; \ - j syscall_error; \ -1: - -#define ret j ra; nop -#endif - -#include <sysdeps/mach/sysdep.h> diff --git a/sysdeps/mach/mips/thread_state.h b/sysdeps/mach/mips/thread_state.h deleted file mode 100644 index a0800de2d0..0000000000 --- a/sysdeps/mach/mips/thread_state.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Mach thread state definitions for machine-independent code. MIPS version. - Copyright (C) 1996, 1997, 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. */ - -#define MACHINE_THREAD_STATE_FLAVOR MIPS_THREAD_STATE -#define MACHINE_THREAD_STATE_COUNT MIPS_THREAD_STATE_COUNT - -#ifdef __PIC__ -#define MACHINE_THREAD_STATE_SET_PC(ts, pc) \ - ((ts)->PC = (ts)->r25 = (unsigned long int) (pc)) -#endif - -#define machine_thread_state mips_thread_state - -#define PC pc -#define SP r29 -#define SYSRETURN r2 - -struct machine_thread_all_state - { - int set; /* Mask of bits (1 << FLAVOR). */ - struct mips_thread_state basic; - struct mips_exc_state exc; - struct mips_float_state fpu; - }; - -#include <sysdeps/mach/thread_state.h> diff --git a/sysdeps/mach/sched_yield.c b/sysdeps/mach/sched_yield.c index 448ca2ce8b..0c35ef0983 100644 --- a/sysdeps/mach/sched_yield.c +++ b/sysdeps/mach/sched_yield.c @@ -1,5 +1,5 @@ /* sched_yield -- yield the processor. Mach version. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2006 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 @@ -28,4 +28,5 @@ __sched_yield (void) (void) __swtch (); return 0; } +libc_hidden_def (__sched_yield) weak_alias (__sched_yield, sched_yield) diff --git a/sysdeps/mips/.cvsignore b/sysdeps/mips/.cvsignore deleted file mode 100644 index 1f69fd919a..0000000000 --- a/sysdeps/mips/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -*.gz *.Z *.tar *.tgz -=* -TODO COPYING* AUTHORS copyr-* copying.* -glibc-* diff --git a/sysdeps/mips/Implies b/sysdeps/mips/Implies deleted file mode 100644 index 8c18cb3034..0000000000 --- a/sysdeps/mips/Implies +++ /dev/null @@ -1,3 +0,0 @@ -# MIPS uses IEEE 754 floating point. -ieee754/flt-32 -ieee754/dbl-64 diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile deleted file mode 100644 index 49ad3e1b91..0000000000 --- a/sysdeps/mips/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -ifeq ($(subdir),misc) -sysdep_headers += regdef.h fpregdef.h sys/regdef.h sys/fpregdef.h \ - sys/asm.h sgidefs.h -endif - -ifeq ($(subdir),setjmp) -sysdep_routines += setjmp_aux -endif - -ifeq ($(subdir),rt) -librt-sysdep_routines += rt-sysdep -endif diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c deleted file mode 100644 index 750a71fd1e..0000000000 --- a/sysdeps/mips/__longjmp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <setjmp.h> -#include <stdlib.h> - -#undef __longjmp - -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - -void -__longjmp (env, val_arg) - __jmp_buf env; - int val_arg; -{ - /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before - the hack around it); force it to use $a1 for the longjmp value. - Without this it saves $a1 in a register which gets clobbered - along the way. */ - register int val asm ("a1"); - - /* Pull back the floating point callee-saved registers. */ - asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); - - /* Get and reconstruct the floating point csr. */ - asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); - asm volatile ("ctc1 $2, $31"); - - /* Get the GP. */ - asm volatile ("lw $gp, %0" : : "m" (env[0].__gp)); - - /* Get the callee-saved registers. */ - asm volatile ("lw $16, %0" : : "m" (env[0].__regs[0])); - asm volatile ("lw $17, %0" : : "m" (env[0].__regs[1])); - asm volatile ("lw $18, %0" : : "m" (env[0].__regs[2])); - asm volatile ("lw $19, %0" : : "m" (env[0].__regs[3])); - asm volatile ("lw $20, %0" : : "m" (env[0].__regs[4])); - asm volatile ("lw $21, %0" : : "m" (env[0].__regs[5])); - asm volatile ("lw $22, %0" : : "m" (env[0].__regs[6])); - asm volatile ("lw $23, %0" : : "m" (env[0].__regs[7])); - - /* Get the PC. */ - asm volatile ("lw $25, %0" : : "m" (env[0].__pc)); - - /* Restore the stack pointer and the FP. They have to be restored - last and in a single asm as gcc, depending on options used, may - use either of them to access env. */ - asm volatile ("lw $29, %0\n\t" - "lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); - -/* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ - if (val == 0) - asm volatile ("li $2, 1"); - else - asm volatile ("move $2, %0" : : "r" (val)); - - asm volatile ("jr $25"); - - /* Avoid `volatile function does return' warnings. */ - for (;;); -} diff --git a/sysdeps/mips/abort-instr.h b/sysdeps/mips/abort-instr.h deleted file mode 100644 index d7d8d501b3..0000000000 --- a/sysdeps/mips/abort-instr.h +++ /dev/null @@ -1,2 +0,0 @@ -/* An instruction which should crash any program is a breakpoint. */ -#define ABORT_INSTRUCTION asm ("break 255") diff --git a/sysdeps/mips/add_n.S b/sysdeps/mips/add_n.S deleted file mode 100644 index c82871f701..0000000000 --- a/sysdeps/mips/add_n.S +++ /dev/null @@ -1,122 +0,0 @@ -/* MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and -store sum in a third limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - s2_ptr $6 - size $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_add_n) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - move $2,$0 - - subu $7,$7,$9 - -L(Loop0): addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - addiu $4,$4,4 - -L(L0): beq $7,$0,L(end) - nop - -L(Loop): addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,L(Loop) - addiu $4,$4,16 - -L(end): addu $11,$11,$2 - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - j $31 - or $2,$2,$8 - .end __mpn_add_n diff --git a/sysdeps/mips/addmul_1.S b/sysdeps/mips/addmul_1.S deleted file mode 100644 index 3e1fc09d10..0000000000 --- a/sysdeps/mips/addmul_1.S +++ /dev/null @@ -1,99 +0,0 @@ -/* MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and -add the product to a second limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_addmul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$3,$2 /* carry from previous addition -> $2 */ - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_addmul_1) diff --git a/sysdeps/mips/bits/atomic.h b/sysdeps/mips/bits/atomic.h deleted file mode 100644 index 167d9a59c8..0000000000 --- a/sysdeps/mips/bits/atomic.h +++ /dev/null @@ -1,303 +0,0 @@ -/* Low-level functions for atomic operations. Mips version. - Copyright (C) 2005 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 _MIPS_BITS_ATOMIC_H -#define _MIPS_BITS_ATOMIC_H 1 - -#include <inttypes.h> -#include <sgidefs.h> - -typedef int32_t atomic32_t; -typedef uint32_t uatomic32_t; -typedef int_fast32_t atomic_fast32_t; -typedef uint_fast32_t uatomic_fast32_t; - -typedef int64_t atomic64_t; -typedef uint64_t uatomic64_t; -typedef int_fast64_t atomic_fast64_t; -typedef uint_fast64_t uatomic_fast64_t; - -typedef intptr_t atomicptr_t; -typedef uintptr_t uatomicptr_t; -typedef intmax_t atomic_max_t; -typedef uintmax_t uatomic_max_t; - -#if _MIPS_SIM == _ABIO32 -#define MIPS_PUSH_MIPS2 ".set mips2\n\t" -#else -#define MIPS_PUSH_MIPS2 -#endif - -/* See the comments in <sys/asm.h> about the use of the sync instruction. */ -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#define MIPS_SYNC_STR_2(X) #X -#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X) -#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC) - -/* Compare and exchange. For all of the "xxx" routines, we expect a - "__prev" and a "__cmp" variable to be provided by the enclosing scope, - in which values are returned. */ - -#define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) - -#define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) - -#define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%4\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%2,2f\n\t" \ - "move %1,%3\n\t" \ - "sc %1,%4\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) -#else -#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%4\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%2,2f\n\t" \ - "move %1,%3\n\t" \ - "scd %1,%4\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") -#endif - -/* For all "bool" routines, we return FALSE if exchange succesful. */ - -#define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - !__cmp; }) - -/* For all "val" routines, return the old value whether exchange - successful or not. */ - -#define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -/* Compare and exchange with "acquire" semantics, ie barrier after. */ - -#define atomic_compare_and_exchange_bool_acq(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -#define atomic_compare_and_exchange_val_acq(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -/* Compare and exchange with "release" semantics, ie barrier before. */ - -#define atomic_compare_and_exchange_bool_rel(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, MIPS_SYNC_STR, "") - -#define atomic_compare_and_exchange_val_rel(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, MIPS_SYNC_STR, "") - - - -/* Atomic exchange (without compare). */ - -#define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \ - (abort (), 0) - -#define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \ - (abort (), 0) - -#define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%3\n\t" \ - "move %1,%2\n\t" \ - "sc %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ - (abort (), 0) -#else -#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\n" \ - "lld %0,%3\n\t" \ - "move %1,%2\n\t" \ - "scd %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) -#endif - -#define atomic_exchange_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR) - -#define atomic_exchange_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "") - - -/* Atomically add value and return the previous (unincremented) value. */ - -#define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -#define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -#define __arch_exchange_and_add_32_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%3\n\t" \ - "addu %1,%0,%2\n\t" \ - "sc %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ - (abort (), (typeof(*mem)) 0) -#else -#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%3\n\t" \ - "daddu %1,%0,%2\n\t" \ - "scd %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) -#endif - -/* ??? Barrier semantics for atomic_exchange_and_add appear to be - undefined. Use full barrier for now, as that's safe. */ -#define atomic_exchange_and_add(mem, value) \ - __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - MIPS_SYNC_STR, MIPS_SYNC_STR) - -/* TODO: More atomic operations could be implemented efficiently; only the - basic requirements are done. */ - -#define atomic_full_barrier() \ - __asm__ __volatile__ (".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - MIPS_SYNC_STR "\n\t" \ - ".set pop" : : : "memory") - -#endif /* bits/atomic.h */ diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h deleted file mode 100644 index a5b5bf53ff..0000000000 --- a/sysdeps/mips/bits/dlfcn.h +++ /dev/null @@ -1,66 +0,0 @@ -/* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996, 1997, 1999, 2000, 2001, 2004 - 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 _DLFCN_H -# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." -#endif - -/* The MODE argument to `dlopen' contains one of the following: */ -#define RTLD_LAZY 0x0001 /* Lazy function call binding. */ -#define RTLD_NOW 0x0002 /* Immediate function call binding. */ -#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ -#define RTLD_NOLOAD 0x00008 /* Do not load the object. */ -#define RTLD_DEEPBIND 0x00010 /* Use deep binding. */ - -/* If the following bit is set in the MODE argument to `dlopen', - the symbols of the loaded object and its dependencies are made - visible as if the object were linked directly into the program. */ -#define RTLD_GLOBAL 0x0004 - -/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. - The implementation does this by default and so we can define the - value to zero. */ -#define RTLD_LOCAL 0 - -/* Do not delete object when closed. */ -#define RTLD_NODELETE 0x01000 - -#ifdef __USE_GNU -/* To support profiling of shared objects it is a good idea to call - the function found using `dlsym' using the following macro since - these calls do not use the PLT. But this would mean the dynamic - loader has no chance to find out when the function is called. The - macro applies the necessary magic so that profiling is possible. - Rewrite - foo = (*fctp) (arg1, arg2); - into - foo = DL_CALL_FCT (fctp, (arg1, arg2)); -*/ -# define DL_CALL_FCT(fctp, args) \ - (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) - -__BEGIN_DECLS - -/* This function calls the profiling functions. */ -extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; - -__END_DECLS - -#endif diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h deleted file mode 100644 index 9586104ccd..0000000000 --- a/sysdeps/mips/bits/endian.h +++ /dev/null @@ -1,13 +0,0 @@ -/* The MIPS architecture has selectable endianness. - This file is for a machine using big-endian mode. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#if __MIPSEB -# define __BYTE_ORDER __BIG_ENDIAN -#endif -#if __MIPSEL -# define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h deleted file mode 100644 index 24e0694ca5..0000000000 --- a/sysdeps/mips/bits/fenv.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 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 <bits/fenv.h> directly; include <fenv.h> instead." -#endif - - -/* Define bits representing the exception. We use the bit positions - of the appropriate bits in the FPU control word. */ -enum - { - FE_INEXACT = 0x04, -#define FE_INEXACT FE_INEXACT - FE_UNDERFLOW = 0x08, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_OVERFLOW = 0x10, -#define FE_OVERFLOW FE_OVERFLOW - FE_DIVBYZERO = 0x20, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_INVALID = 0x40, -#define FE_INVALID FE_INVALID - }; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The MIPS FPU supports all of the four defined rounding modes. We - use again the bit positions in the FPU control word as the values - for the appropriate macros. */ -enum - { - FE_TONEAREST = 0x0, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDZERO = 0x1, -#define FE_TOWARDZERO FE_TOWARDZERO - FE_UPWARD = 0x2, -#define FE_UPWARD FE_UPWARD - FE_DOWNWARD = 0x3 -#define FE_DOWNWARD FE_DOWNWARD - }; - - -/* Type representing exception flags. */ -typedef unsigned short int fexcept_t; - - -/* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ -typedef struct - { - unsigned int __fp_control_register; - } -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 diff --git a/sysdeps/mips/bits/ipctypes.h b/sysdeps/mips/bits/ipctypes.h deleted file mode 100644 index 0956e7d58c..0000000000 --- a/sysdeps/mips/bits/ipctypes.h +++ /dev/null @@ -1,32 +0,0 @@ -/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version - Copyright (C) 2002 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. */ - -/* - * Never include <bits/ipctypes.h> directly. - */ - -#ifndef _BITS_IPCTYPES_H -#define _BITS_IPCTYPES_H 1 - -#include <bits/types.h> - -typedef __SLONG32_TYPE __ipc_pid_t; - - -#endif /* bits/ipctypes.h */ diff --git a/sysdeps/mips/bits/link.h b/sysdeps/mips/bits/link.h deleted file mode 100644 index 3d77a4c4a5..0000000000 --- a/sysdeps/mips/bits/link.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (C) 2005 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 _LINK_H -# error "Never include <bits/link.h> directly; use <link.h> instead." -#endif - -#include <sgidefs.h> - -#if _MIPS_SIM == _ABIO32 - -/* Registers for entry into PLT on MIPS. */ -typedef struct La_mips_32_regs -{ - uint32_t lr_reg[4]; /* $a0 through $a3 */ - double lr_fpreg[2]; /* $f12 and $f14 */ - uint32_t lr_ra; - uint32_t lr_sp; -} La_mips_32_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_32_retval -{ - uint32_t lrv_v0; - uint32_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_32_retval; - -#else - -typedef struct La_mips_64_regs -{ - uint64_t lr_reg[8]; /* $a0 through $a7 */ - double lr_fpreg[8]; /* $f12 throgh $f19 */ - uint64_t lr_ra; - uint64_t lr_sp; -} La_mips_64_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_64_retval -{ - uint64_t lrv_v0; - uint64_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_64_retval; - -#endif - -__BEGIN_DECLS - -#if _MIPS_SIM == _ABIO32 - -extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_32_regs *__inregs, - La_mips_32_retval *__outregs, - const char *symname); - -#elif _MIPS_SIM == _ABIN32 - -extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *symname); - -#else - -extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *symname); - -#endif - -__END_DECLS diff --git a/sysdeps/mips/bits/mathdef.h b/sysdeps/mips/bits/mathdef.h deleted file mode 100644 index 99be0db2b5..0000000000 --- a/sysdeps/mips/bits/mathdef.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 - 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 <bits/mathdef.h> directly; include <math.h> instead" -#endif - -#include <sgidefs.h> - -#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF -# define _MATH_H_MATHDEF 1 - -/* Normally, there is no long double type and the `float' and `double' - expressions are evaluated as `double'. */ -typedef double float_t; /* `float' expressions are evaluated as - `double'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -# define FP_ILOGB0 (-2147483647) -# define FP_ILOGBNAN 2147483647 - -#endif /* ISO C99 */ - -#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/sysdeps/mips/bits/nan.h b/sysdeps/mips/bits/nan.h deleted file mode 100644 index baaaa551fb..0000000000 --- a/sysdeps/mips/bits/nan.h +++ /dev/null @@ -1,56 +0,0 @@ -/* `NAN' constant for IEEE 754 machines. - Copyright (C) 1992, 1996, 1997, 1999, 2002, 2004 - 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 <bits/nan.h> directly; include <math.h> instead." -#endif - - -/* IEEE Not A Number (QNaN). Note that MIPS has the QNaN and SNaN patterns - reversed compared to most other architectures. The IEEE spec left - the definition of this open to implementations, and for MIPS the top - bit of the mantissa must be SET to indicate a SNaN. */ - -#if __GNUC_PREREQ(3,3) - -# define NAN (__builtin_nanf("")) - -#elif defined __GNUC__ - -# define NAN \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ - { __l: 0x7fbfffffUL }).__d) - -#else - -# include <endian.h> - -# if __BYTE_ORDER == __BIG_ENDIAN -# define __nan_bytes { 0x7f, 0xbf, 0xff, 0xff } -# endif -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f } -# endif - -static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes }; -# define NAN (__nan_union.__d) - -#endif /* GCC. */ diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h deleted file mode 100644 index 4f159c4988..0000000000 --- a/sysdeps/mips/bits/setjmp.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992,1993,1995,1997,2000,2002,2003,2004,2005,2006 - 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 _MIPS_BITS_SETJMP_H -#define _MIPS_BITS_SETJMP_H 1 - -#if !defined(_SETJMP_H) && !defined(_PTHREAD_H) -# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." -#endif - -#include <sgidefs.h> - -typedef struct - { -#if _MIPS_SIM == _ABIO32 - /* Program counter. */ - __ptr_t __pc; - - /* Stack pointer. */ - __ptr_t __sp; - - /* Callee-saved registers s0 through s7. */ - int __regs[8]; - - /* The frame pointer. */ - __ptr_t __fp; - - /* The global pointer. */ - __ptr_t __gp; -#else - /* Program counter. */ - __extension__ long long __pc; - - /* Stack pointer. */ - __extension__ long long __sp; - - /* Callee-saved registers s0 through s7. */ - __extension__ long long __regs[8]; - - /* The frame pointer. */ - __extension__ long long __fp; - - /* The global pointer. */ - __extension__ long long __gp; -#endif - - /* Floating point status register. */ - int __fpc_csr; - - /* Callee-saved floating point registers. */ -#if _MIPS_SIM == _ABI64 - double __fpregs[8]; -#else - double __fpregs[6]; -#endif - } __jmp_buf[1]; - -#endif /* _MIPS_BITS_SETJMP_H */ diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h deleted file mode 100644 index 666c7ad07e..0000000000 --- a/sysdeps/mips/bits/wordsize.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2002, 2003 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 _MIPS_SZPTR diff --git a/sysdeps/mips/bsd-_setjmp.S b/sysdeps/mips/bsd-_setjmp.S deleted file mode 100644 index 5e3ad50305..0000000000 --- a/sysdeps/mips/bsd-_setjmp.S +++ /dev/null @@ -1,43 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS version. - Copyright (C) 1996, 1997, 2000, 2002 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 just does a tail-call to `__sigsetjmp (ARG, 0)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sysdep.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (_setjmp) -#ifdef __PIC__ - .set noreorder - .cpload t9 - .set reorder - la t9, C_SYMBOL_NAME (__sigsetjmp) -#endif - move a1,zero /* Pass a second argument of zero. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end _setjmp -libc_hidden_def (_setjmp) diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S deleted file mode 100644 index 0aea011328..0000000000 --- a/sysdeps/mips/bsd-setjmp.S +++ /dev/null @@ -1,42 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version. - Copyright (C) 1996, 1997, 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. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sysdep.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (setjmp) - .set noreorder -#ifdef __PIC__ - .cpload t9 - .set reorder - la t9, C_SYMBOL_NAME (__sigsetjmp) -#endif - li a1, 1 /* Pass a second argument of one. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end setjmp diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h deleted file mode 100644 index dfd03ba317..0000000000 --- a/sysdeps/mips/dl-dtprocnum.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Configuration of lookup functions. MIPS version. - Copyright (C) 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. */ - -/* Number of extra dynamic section entries for this architecture. By - default there are none. */ -#define DT_THISPROCNUM DT_MIPS_NUM diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h deleted file mode 100644 index c04609f9bc..0000000000 --- a/sysdeps/mips/dl-machine.h +++ /dev/null @@ -1,611 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. MIPS version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. - - 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. */ - -/* FIXME: Profiling of shared libraries is not implemented yet. */ -#ifndef dl_machine_h -#define dl_machine_h - -#define ELF_MACHINE_NAME "MIPS" - -#define ELF_MACHINE_NO_PLT - -#include <entry.h> - -#ifndef ENTRY_POINT -#error ENTRY_POINT needs to be defined for MIPS. -#endif - -#include <sgidefs.h> -#include <sys/asm.h> -#include <dl-tls.h> - -/* The offset of gp from GOT might be system-dependent. It's set by - ld. The same value is also */ -#define OFFSET_GP_GOT 0x7ff0 - -#ifndef _RTLD_PROLOGUE -# define _RTLD_PROLOGUE(entry) \ - ".globl\t" __STRING(entry) "\n\t" \ - ".ent\t" __STRING(entry) "\n\t" \ - ".type\t" __STRING(entry) ", @function\n" \ - __STRING(entry) ":\n\t" -#endif - -#ifndef _RTLD_EPILOGUE -# define _RTLD_EPILOGUE(entry) \ - ".end\t" __STRING(entry) "\n\t" \ - ".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t" -#endif - -/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. - This makes no sense on MIPS but we have to define this to R_MIPS_REL32 - to avoid the asserts in dl-lookup.c from blowing. */ -#define ELF_MACHINE_JMP_SLOT R_MIPS_REL32 -#define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT - -/* Translate a processor specific dynamic tag to the index - in l_info array. */ -#define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM) - -/* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in - with the run-time address of the r_debug structure */ -#define ELF_MACHINE_DEBUG_SETUP(l,r) \ -do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ - *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ - (ElfW(Addr)) (r); \ - } while (0) - -/* Return nonzero iff ELF header is compatible with the running host. */ -static inline int __attribute_used__ -elf_machine_matches_host (const ElfW(Ehdr) *ehdr) -{ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 - /* Don't link o32 and n32 together. */ - if (((ehdr->e_flags & EF_MIPS_ABI2) != 0) != (_MIPS_SIM == _ABIN32)) - return 0; -#endif - - switch (ehdr->e_machine) - { - case EM_MIPS: - case EM_MIPS_RS3_LE: - return 1; - default: - return 0; - } -} - -static inline ElfW(Addr) * -elf_mips_got_from_gpreg (ElfW(Addr) gpreg) -{ - /* FIXME: the offset of gp from GOT may be system-dependent. */ - return (ElfW(Addr) *) (gpreg - OFFSET_GP_GOT); -} - -/* Return the link-time address of _DYNAMIC. Conveniently, this is the - first element of the GOT. This must be inlined in a function which - uses global data. We assume its $gp points to the primary GOT. */ -static inline ElfW(Addr) -elf_machine_dynamic (void) -{ - register ElfW(Addr) gp __asm__ ("$28"); - return *elf_mips_got_from_gpreg (gp); -} - -#define STRINGXP(X) __STRING(X) -#define STRINGXV(X) STRINGV_(X) -#define STRINGV_(...) # __VA_ARGS__ - -/* Return the run-time load address of the shared object. */ -static inline ElfW(Addr) -elf_machine_load_address (void) -{ - ElfW(Addr) addr; - asm (" .set noreorder\n" - " " STRINGXP (PTR_LA) " %0, 0f\n" - " bltzal $0, 0f\n" - " nop\n" - "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n" - " .set reorder\n" - : "=r" (addr) - : /* No inputs */ - : "$31"); - return addr; -} - -/* The MSB of got[1] of a gnu object is set to identify gnu objects. */ -#if _MIPS_SIM == _ABI64 -# define ELF_MIPS_GNU_GOT1_MASK 0x8000000000000000L -#else -# define ELF_MIPS_GNU_GOT1_MASK 0x80000000L -#endif - -/* We can't rely on elf_machine_got_rel because _dl_object_relocation_scope - fiddles with global data. */ -#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \ -do { \ - struct link_map *map = &bootstrap_map; \ - ElfW(Sym) *sym; \ - ElfW(Addr) *got; \ - int i, n; \ - \ - got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); \ - \ - if (__builtin_expect (map->l_addr == 0, 1)) \ - break; \ - \ - /* got[0] is reserved. got[1] is also reserved for the dynamic object \ - generated by gnu ld. Skip these reserved entries from \ - relocation. */ \ - i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1; \ - n = map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \ - \ - /* Add the run-time displacement to all local got entries. */ \ - while (i < n) \ - got[i++] += map->l_addr; \ - \ - /* Handle global got entries. */ \ - got += n; \ - sym = (ElfW(Sym) *) D_PTR(map, l_info[DT_SYMTAB]) \ - + map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; \ - i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val \ - - map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val); \ - \ - while (i--) \ - { \ - if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_COMMON) \ - *got = map->l_addr + sym->st_value; \ - else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC \ - && *got != sym->st_value) \ - *got += map->l_addr; \ - else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION) \ - { \ - if (sym->st_other == 0) \ - *got += map->l_addr; \ - } \ - else \ - *got = map->l_addr + sym->st_value; \ - \ - got++; \ - sym++; \ - } \ -} while(0) - - -/* Mask identifying addresses reserved for the user program, - where the dynamic linker should not map anything. */ -#define ELF_MACHINE_USER_ADDRESS_MASK 0x80000000UL - - -/* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. - Note how we have to be careful about two things: - - 1) That we allocate a minimal stack of 24 bytes for - every function call, the MIPS ABI states that even - if all arguments are passed in registers the procedure - called can use the 16 byte area pointed to by $sp - when it is called to store away the arguments passed - to it. - - 2) That under Linux the entry is named __start - and not just plain _start. */ - -#define RTLD_START asm (\ - ".text\n\ - " _RTLD_PROLOGUE(ENTRY_POINT) "\ - " STRINGXV(SETUP_GPX($25)) "\n\ - " STRINGXV(SETUP_GPX64($18,$25)) "\n\ - # i386 ABI book says that the first entry of GOT holds\n\ - # the address of the dynamic structure. Though MIPS ABI\n\ - # doesn't say nothing about this, I emulate this here.\n\ - " STRINGXP(PTR_LA) " $4, _DYNAMIC\n\ - # Subtract OFFSET_GP_GOT\n\ - " STRINGXP(PTR_S) " $4, -0x7ff0($28)\n\ - move $4, $29\n\ - " STRINGXP(PTR_SUBIU) " $29, 16\n\ - \n\ - " STRINGXP(PTR_LA) " $8, .Lcoff\n\ - bltzal $8, .Lcoff\n\ -.Lcoff: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\ - \n\ - " STRINGXP(PTR_LA) " $25, _dl_start\n\ - " STRINGXP(PTR_ADDU) " $25, $8\n\ - jalr $25\n\ - \n\ - " STRINGXP(PTR_ADDIU) " $29, 16\n\ - # Get the value of label '_dl_start_user' in t9 ($25).\n\ - " STRINGXP(PTR_LA) " $25, _dl_start_user\n\ - " _RTLD_EPILOGUE(ENTRY_POINT) "\ - \n\ - \n\ - " _RTLD_PROLOGUE(_dl_start_user) "\ - " STRINGXP(SETUP_GP) "\n\ - " STRINGXV(SETUP_GP64($18,_dl_start_user)) "\n\ - move $16, $28\n\ - # Save the user entry point address in a saved register.\n\ - move $17, $2\n\ - # See if we were run as a command with the executable file\n\ - # name as an extra leading argument.\n\ - lw $2, _dl_skip_args\n\ - beq $2, $0, 1f\n\ - # Load the original argument count.\n\ - " STRINGXP(PTR_L) " $4, 0($29)\n\ - # Subtract _dl_skip_args from it.\n\ - subu $4, $2\n\ - # Adjust the stack pointer to skip _dl_skip_args words.\n\ - sll $2, " STRINGXP (PTRLOG) "\n\ - " STRINGXP(PTR_ADDU) " $29, $2\n\ - # Save back the modified argument count.\n\ - " STRINGXP(PTR_S) " $4, 0($29)\n\ -1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\ - " STRINGXP(PTR_L) " $4, _rtld_local\n\ - " STRINGXP(PTR_L) /* or lw??? fixme */ " $5, 0($29)\n\ - " STRINGXP(PTR_LA) " $6, " STRINGXP (PTRSIZE) "($29)\n\ - sll $7, $5, " STRINGXP (PTRLOG) "\n\ - " STRINGXP(PTR_ADDU) " $7, $7, $6\n\ - " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\ - # Make sure the stack pointer is aligned for _dl_init_internal.\n\ - and $2, $29, -2 * " STRINGXP(SZREG) "\n\ - " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\ - " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\ - " STRINGXP(SAVE_GP(16)) "\n\ - # Call the function to run the initializers.\n\ - jal _dl_init_internal\n\ - # Restore the stack pointer for _start.\n\ - " STRINGXP(PTR_L) " $29, 32-" STRINGXP(SZREG) "($29)\n\ - # Pass our finalizer function to the user in $2 as per ELF ABI.\n\ - " STRINGXP(PTR_LA) " $2, _dl_fini\n\ - # Jump to the user entry point.\n\ - move $25, $17\n\ - jr $25\n\t"\ - _RTLD_EPILOGUE(_dl_start_user)\ - ".previous"\ -); - -/* The MIPS never uses Elfxx_Rela relocations. */ -#define ELF_MACHINE_NO_RELA 1 - -/* Names of the architecture-specific auditing callback functions. */ -# if _MIPS_SIM == _ABIO32 -# define ARCH_LA_PLTENTER mips_o32_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_o32_gnu_pltexit -# elif _MIPS_SIM == _ABIN32 -# define ARCH_LA_PLTENTER mips_n32_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_n32_gnu_pltexit -# else -# define ARCH_LA_PLTENTER mips_n64_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_n64_gnu_pltexit -# endif - -#endif /* !dl_machine_h */ - -#ifdef RESOLVE_MAP - -/* Perform the relocation specified by RELOC and SYM (which is fully resolved). - MAP is the object containing the reloc. */ - -auto inline void -__attribute__ ((always_inline)) -elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, - const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) -{ - const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info); - -#if !defined RTLD_BOOTSTRAP && !defined SHARED - /* This is defined in rtld.c, but nowhere in the static libc.a; - make the reference weak so static programs can still link. This - declaration cannot be done when compiling rtld.c (i.e. #ifdef - RTLD_BOOTSTRAP) because rtld.c contains the common defn for - _dl_rtld_map, which is incompatible with a weak decl in the same - file. */ - weak_extern (GL(dl_rtld_map)); -#endif - - switch (r_type) - { -#if defined (USE_TLS) && !defined (RTLD_BOOTSTRAP) -# if _MIPS_SIM == _ABI64 - case R_MIPS_TLS_DTPMOD64: - case R_MIPS_TLS_DTPREL64: - case R_MIPS_TLS_TPREL64: -# else - case R_MIPS_TLS_DTPMOD32: - case R_MIPS_TLS_DTPREL32: - case R_MIPS_TLS_TPREL32: -# endif - { - struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); - Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; - - if (sym) - value += sym->st_value; - - switch (r_type) - { - case R_MIPS_TLS_DTPMOD64: - case R_MIPS_TLS_DTPMOD32: - if (sym_map) - *(ElfW(Word) *)reloc_addr = sym_map->l_tls_modid; - break; - - case R_MIPS_TLS_DTPREL64: - case R_MIPS_TLS_DTPREL32: - *(ElfW(Word) *)reloc_addr += TLS_DTPREL_VALUE (sym); - break; - - case R_MIPS_TLS_TPREL32: - case R_MIPS_TLS_TPREL64: - CHECK_STATIC_TLS (map, sym_map); - *(ElfW(Word) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym); - break; - } - - break; - } -#endif - -#if _MIPS_SIM == _ABI64 - case (R_MIPS_64 << 8) | R_MIPS_REL32: -#else - case R_MIPS_REL32: -#endif - { - int symidx = ELFW(R_SYM) (reloc->r_info); - ElfW(Addr) reloc_value; - - /* Support relocations on mis-aligned offsets. Should we ever - implement RELA, this should be replaced with an assignment - from reloc->r_addend. */ - __builtin_memcpy (&reloc_value, reloc_addr, sizeof (reloc_value)); - - if (symidx) - { - const ElfW(Word) gotsym - = (const ElfW(Word)) map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - - if ((ElfW(Word))symidx < gotsym) - { - /* This wouldn't work for a symbol imported from other - libraries for which there's no GOT entry, but MIPS - requires every symbol referenced in a dynamic - relocation to have a GOT entry in the primary GOT, - so we only get here for locally-defined symbols. - For section symbols, we should *NOT* be adding - sym->st_value (per the definition of the meaning of - S in reloc expressions in the ELF64 MIPS ABI), - since it should have already been added to - reloc_value by the linker, but older versions of - GNU ld didn't add it, and newer versions don't emit - useless relocations to section symbols any more, so - it is safe to keep on adding sym->st_value, even - though it's not ABI compliant. Some day we should - bite the bullet and stop doing this. */ -#ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) -#endif - reloc_value += sym->st_value + map->l_addr; - } - else - { -#ifndef RTLD_BOOTSTRAP - const ElfW(Addr) *got - = (const ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); - const ElfW(Word) local_gotno - = (const ElfW(Word)) - map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - - reloc_value += got[symidx + local_gotno - gotsym]; -#endif - } - } - else -#ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) -#endif - reloc_value += map->l_addr; - - __builtin_memcpy (reloc_addr, &reloc_value, sizeof (reloc_value)); - } - break; - case R_MIPS_NONE: /* Alright, Wilbur. */ - break; -#if _MIPS_SIM == _ABI64 - case R_MIPS_64: - /* For full compliance with the ELF64 ABI, one must precede the - _REL32/_64 pair of relocations with a _64 relocation, such - that the in-place addend is read as a 64-bit value. IRIX - didn't pick up on this requirement, so we treat the - _REL32/_64 relocation as a 64-bit relocation even if it's by - itself. For ABI compliance, we ignore such _64 dummy - relocations. For RELA, this may be simply removed, since - it's totally unnecessary. */ - if (ELFW(R_SYM) (reloc->r_info) == 0) - break; - /* Fall through. */ -#endif - default: - _dl_reloc_bad_type (map, r_type, 0); - break; - } -} - -auto inline void -__attribute__((always_inline)) -elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, - void *const reloc_addr) -{ - /* XXX Nothing to do. There is no relative relocation, right? */ -} - -auto inline void -__attribute__((always_inline)) -elf_machine_lazy_rel (struct link_map *map, - ElfW(Addr) l_addr, const ElfW(Rel) *reloc) -{ - /* Do nothing. */ -} - -auto inline void -__attribute__ ((always_inline)) -elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, - const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) -{ -} - -auto inline void -__attribute__((always_inline)) -elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, - void *const reloc_addr) -{ -} - -#ifndef RTLD_BOOTSTRAP -/* Relocate GOT. */ -auto inline void -__attribute__((always_inline)) -elf_machine_got_rel (struct link_map *map, int lazy) -{ - ElfW(Addr) *got; - ElfW(Sym) *sym; - const ElfW(Half) *vernum; - int i, n, symidx; - -#define RESOLVE_GOTSYM(sym,vernum,sym_index) \ - ({ \ - const ElfW(Sym) *ref = sym; \ - const struct r_found_version *version \ - = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \ - struct link_map *sym_map; \ - sym_map = RESOLVE_MAP (&ref, version, R_MIPS_REL32); \ - ref ? sym_map->l_addr + ref->st_value : 0; \ - }) - - if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL) - vernum = (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); - else - vernum = NULL; - - got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); - - n = map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - /* The dynamic linker's local got entries have already been relocated. */ - if (map != &GL(dl_rtld_map)) - { - /* got[0] is reserved. got[1] is also reserved for the dynamic object - generated by gnu ld. Skip these reserved entries from relocation. */ - i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1; - - /* Add the run-time displacement to all local got entries if - needed. */ - if (__builtin_expect (map->l_addr != 0, 0)) - { - while (i < n) - got[i++] += map->l_addr; - } - } - - /* Handle global got entries. */ - got += n; - /* Keep track of the symbol index. */ - symidx = map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - sym = (ElfW(Sym) *) D_PTR (map, l_info[DT_SYMTAB]) + symidx; - i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val - - map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val); - - /* This loop doesn't handle Quickstart. */ - while (i--) - { - if (sym->st_shndx == SHN_UNDEF) - { - if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC - && sym->st_value && lazy) - *got = sym->st_value + map->l_addr; - else - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - } - else if (sym->st_shndx == SHN_COMMON) - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC - && *got != sym->st_value - && lazy) - *got += map->l_addr; - else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION) - { - if (sym->st_other == 0) - *got += map->l_addr; - } - else - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - - ++got; - ++sym; - ++symidx; - } - -#undef RESOLVE_GOTSYM -} -#endif - -/* Set up the loaded object described by L so its stub function - will jump to the on-demand fixup code __dl_runtime_resolve. */ - -auto inline int -__attribute__((always_inline)) -elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) -{ -# ifndef RTLD_BOOTSTRAP - ElfW(Addr) *got; - extern void _dl_runtime_resolve (ElfW(Word)); - extern int _dl_mips_gnu_objects; - - if (lazy) - { - /* The GOT entries for functions have not yet been filled in. - Their initial contents will arrange when called to put an - offset into the .dynsym section in t8, the return address - in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */ - got = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); - - /* This function will get called to fix up the GOT entry indicated by - the register t8, and then jump to the resolved address. */ - got[0] = (ElfW(Addr)) &_dl_runtime_resolve; - - /* Store l to _GLOBAL_OFFSET_TABLE[1] for gnu object. The MSB - of got[1] of a gnu object is set to identify gnu objects. - Where we can store l for non gnu objects? XXX */ - if ((got[1] & ELF_MIPS_GNU_GOT1_MASK) != 0) - got[1] = ((ElfW(Addr)) l | ELF_MIPS_GNU_GOT1_MASK); - else - _dl_mips_gnu_objects = 0; - } - - /* Relocate global offset table. */ - elf_machine_got_rel (l, lazy); - -# endif - return lazy; -} - -#endif /* RESOLVE_MAP */ diff --git a/sysdeps/mips/dl-tls.h b/sysdeps/mips/dl-tls.h deleted file mode 100644 index 6d3ed6f5a4..0000000000 --- a/sysdeps/mips/dl-tls.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005 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. */ - - -/* Type used for the representation of TLS information in the GOT. */ -typedef struct -{ - unsigned long int ti_module; - unsigned long int ti_offset; -} tls_index; - -/* The thread pointer points 0x7000 past the first static TLS block. */ -#define TLS_TP_OFFSET 0x7000 - -/* Dynamic thread vector pointers point 0x8000 past the start of each - TLS block. */ -#define TLS_DTV_OFFSET 0x8000 - -/* Compute the value for a GOTTPREL reloc. */ -#define TLS_TPREL_VALUE(sym_map, sym) \ - ((sym_map)->l_tls_offset + (sym)->st_value - TLS_TP_OFFSET) - -/* Compute the value for a DTPREL reloc. */ -#define TLS_DTPREL_VALUE(sym) \ - ((sym)->st_value - TLS_DTV_OFFSET) - -extern void *__tls_get_addr (tls_index *ti); - -# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET) -# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET) diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c deleted file mode 100644 index 459adf9a8e..0000000000 --- a/sysdeps/mips/dl-trampoline.c +++ /dev/null @@ -1,272 +0,0 @@ -/* PLT trampoline. MIPS version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. - - 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. */ - -/* FIXME: Profiling of shared libraries is not implemented yet. */ - -#include <sysdep.h> -#include <link.h> -#include <elf.h> -#include <ldsodefs.h> -#include <dl-machine.h> - -/* Get link map for callers object containing STUB_PC. */ -static inline struct link_map * -elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) -{ - extern int _dl_mips_gnu_objects; - - /* got[1] is reserved to keep its link map address for the shared - object generated by the gnu linker. If all are such objects, we - can find the link map from current GPREG simply. If not so, get - the link map for caller's object containing STUB_PC. */ - - if (_dl_mips_gnu_objects) - { - ElfW(Addr) *got = elf_mips_got_from_gpreg (gpreg); - ElfW(Word) g1; - - g1 = ((ElfW(Word) *) got)[1]; - - if ((g1 & ELF_MIPS_GNU_GOT1_MASK) != 0) - { - struct link_map *l = - (struct link_map *) (g1 & ~ELF_MIPS_GNU_GOT1_MASK); - ElfW(Addr) base, limit; - const ElfW(Phdr) *p = l->l_phdr; - ElfW(Half) this, nent = l->l_phnum; - - /* For the common case of a stub being called from the containing - object, STUB_PC will point to somewhere within the object that - is described by the link map fetched via got[1]. Otherwise we - have to scan all maps. */ - for (this = 0; this < nent; this++) - { - if (p[this].p_type == PT_LOAD) - { - base = p[this].p_vaddr + l->l_addr; - limit = base + p[this].p_memsz; - if (stub_pc >= base && stub_pc < limit) - return l; - } - } - } - } - - struct link_map *l; - Lmid_t nsid; - - for (nsid = 0; nsid < DL_NNS; ++nsid) - for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next) - { - ElfW(Addr) base, limit; - const ElfW(Phdr) *p = l->l_phdr; - ElfW(Half) this, nent = l->l_phnum; - - for (this = 0; this < nent; ++this) - { - if (p[this].p_type == PT_LOAD) - { - base = p[this].p_vaddr + l->l_addr; - limit = base + p[this].p_memsz; - if (stub_pc >= base && stub_pc < limit) - return l; - } - } - } - - _dl_signal_error (0, NULL, NULL, "cannot find runtime link map"); - return NULL; -} - -/* Define mips specific runtime resolver. The function __dl_runtime_resolve - is called from assembler function _dl_runtime_resolve which converts - special argument registers t7 ($15) and t8 ($24): - t7 address to return to the caller of the function - t8 index for this function symbol in .dynsym - to usual c arguments. - - Other architectures call fixup from dl-runtime.c in - _dl_runtime_resolve. MIPS instead calls __dl_runtime_resolve. We - have to use our own version because of the way the got section is - treated on MIPS (we've also got ELF_MACHINE_PLT defined). */ - -/* The flag _dl_mips_gnu_objects is set if all dynamic objects are - generated by the gnu linker. */ -int _dl_mips_gnu_objects = 1; - -#define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) - -/* This is called from assembly stubs below which the compiler can't see. */ -static ElfW(Addr) -__dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr)) - __attribute_used__; - -static ElfW(Addr) -__dl_runtime_resolve (ElfW(Word) sym_index, - ElfW(Word) return_address, - ElfW(Addr) old_gpreg, - ElfW(Addr) stub_pc) -{ - struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); - const ElfW(Sym) *const symtab - = (const ElfW(Sym) *) D_PTR (l, l_info[DT_SYMTAB]); - const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); - ElfW(Addr) *got - = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); - const ElfW(Word) local_gotno - = (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - const ElfW(Word) gotsym - = (const ElfW(Word)) l->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - const ElfW(Sym) *sym = &symtab[sym_index]; - struct link_map *sym_map; - ElfW(Addr) value; - - /* FIXME: The symbol versioning stuff is not tested yet. */ - if (__builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0) - { - switch (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL) - { - default: - { - const ElfW(Half) *vernum = - (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]); - ElfW(Half) ndx = vernum[sym_index] & 0x7fff; - const struct r_found_version *version = &l->l_versions[ndx]; - - if (version->hash != 0) - { - sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, - &sym, l->l_scope, version, - ELF_RTYPE_CLASS_PLT, 0, 0); - break; - } - /* Fall through. */ - } - case 0: - sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym, - l->l_scope, 0, ELF_RTYPE_CLASS_PLT, - DL_LOOKUP_ADD_DEPENDENCY, 0); - } - - /* Currently value contains the base load address of the object - that defines sym. Now add in the symbol offset. */ - value = (sym ? sym_map->l_addr + sym->st_value : 0); - } - else - /* We already found the symbol. The module (and therefore its load - address) is also known. */ - value = l->l_addr + sym->st_value; - - /* Apply the relocation with that value. */ - *(got + local_gotno + sym_index - gotsym) = value; - - return value; -} - -#if _MIPS_SIM == _ABIO32 -#define ELF_DL_FRAME_SIZE 40 - -#define ELF_DL_SAVE_ARG_REGS "\ - sw $15, 36($29)\n \ - sw $4, 16($29)\n \ - sw $5, 20($29)\n \ - sw $6, 24($29)\n \ - sw $7, 28($29)\n \ -" - -#define ELF_DL_RESTORE_ARG_REGS "\ - lw $31, 36($29)\n \ - lw $4, 16($29)\n \ - lw $5, 20($29)\n \ - lw $6, 24($29)\n \ - lw $7, 28($29)\n \ -" - -#define IFABIO32(X) X - -#else /* _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 */ - -#define ELF_DL_FRAME_SIZE 80 - -#define ELF_DL_SAVE_ARG_REGS "\ - sd $15, 72($29)\n \ - sd $4, 8($29)\n \ - sd $5, 16($29)\n \ - sd $6, 24($29)\n \ - sd $7, 32($29)\n \ - sd $8, 40($29)\n \ - sd $9, 48($29)\n \ - sd $10, 56($29)\n \ - sd $11, 64($29)\n \ -" - -#define ELF_DL_RESTORE_ARG_REGS "\ - ld $31, 72($29)\n \ - ld $4, 8($29)\n \ - ld $5, 16($29)\n \ - ld $6, 24($29)\n \ - ld $7, 32($29)\n \ - ld $8, 40($29)\n \ - ld $9, 48($29)\n \ - ld $10, 56($29)\n \ - ld $11, 64($29)\n \ -" - -#define IFABIO32(X) - -#endif - -asm ("\n\ - .text\n\ - .align 2\n\ - .globl _dl_runtime_resolve\n\ - .type _dl_runtime_resolve,@function\n\ - .ent _dl_runtime_resolve\n\ -_dl_runtime_resolve:\n\ - .frame $29, " STRINGXP(ELF_DL_FRAME_SIZE) ", $31\n\ - .set noreorder\n\ - # Save GP.\n\ - move $3, $28\n\ - # Save arguments and sp value in stack.\n\ - " STRINGXP(PTR_SUBIU) " $29, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\ - # Modify t9 ($25) so as to point .cpload instruction.\n\ - " IFABIO32(STRINGXP(PTR_ADDIU) " $25, 12\n") "\ - # Compute GP.\n\ - " STRINGXP(SETUP_GP) "\n\ - " STRINGXV(SETUP_GP64 (0, _dl_runtime_resolve)) "\n\ - .set reorder\n\ - # Save slot call pc.\n\ - move $2, $31\n\ - " IFABIO32(STRINGXP(CPRESTORE(32))) "\n\ - " ELF_DL_SAVE_ARG_REGS "\ - move $4, $24\n\ - move $5, $15\n\ - move $6, $3\n\ - move $7, $2\n\ - jal __dl_runtime_resolve\n\ - " ELF_DL_RESTORE_ARG_REGS "\ - " STRINGXP(RESTORE_GP64) "\n\ - " STRINGXP(PTR_ADDIU) " $29, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\ - move $25, $2\n\ - jr $25\n\ - .end _dl_runtime_resolve\n\ - .previous\n\ -"); diff --git a/sysdeps/mips/elf/configure b/sysdeps/mips/elf/configure deleted file mode 100644 index 3d90a1e420..0000000000 --- a/sysdeps/mips/elf/configure +++ /dev/null @@ -1,46 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/mips/elf. - -if test "$usetls" != no; then -# Check for support of thread-local storage handling in assembler and -# linker. -echo "$as_me:$LINENO: checking for MIPS TLS support" >&5 -echo $ECHO_N "checking for MIPS TLS support... $ECHO_C" >&6 -if test "${libc_cv_mips_tls+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <<\EOF - .section ".tdata", "awT", %progbits - .globl foo -foo: .long 1 - .section ".tbss", "awT", %nobits - .globl bar -bar: .skip 4 - .text - - lw $25, %call16(__tls_get_addr)($28) - jalr $25 - addiu $4, $28, %tlsgd(x) -EOF -if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_mips_tls=yes -else - libc_cv_mips_tls=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $libc_cv_mips_tls" >&5 -echo "${ECHO_T}$libc_cv_mips_tls" >&6 -if test $libc_cv_mips_tls = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_TLS_SUPPORT 1 -_ACEOF - -fi -fi - diff --git a/sysdeps/mips/elf/configure.in b/sysdeps/mips/elf/configure.in deleted file mode 100644 index ecb9108c12..0000000000 --- a/sysdeps/mips/elf/configure.in +++ /dev/null @@ -1,35 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/mips/elf. - -if test "$usetls" != no; then -# Check for support of thread-local storage handling in assembler and -# linker. -AC_CACHE_CHECK(for MIPS TLS support, libc_cv_mips_tls, [dnl -cat > conftest.s <<\EOF - .section ".tdata", "awT", %progbits - .globl foo -foo: .long 1 - .section ".tbss", "awT", %nobits - .globl bar -bar: .skip 4 - .text - - lw $25, %call16(__tls_get_addr)($28) - jalr $25 - addiu $4, $28, %tlsgd(x) -EOF -dnl -if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_mips_tls=yes -else - libc_cv_mips_tls=no -fi -rm -f conftest*]) -if test $libc_cv_mips_tls = yes; then - AC_DEFINE(HAVE_TLS_SUPPORT) -fi -fi - -dnl No MIPS GCC supports accessing static and hidden symbols in an -dnl position independent way. -dnl AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/sysdeps/mips/elf/ldsodefs.h b/sysdeps/mips/elf/ldsodefs.h deleted file mode 100644 index 3868b50ff6..0000000000 --- a/sysdeps/mips/elf/ldsodefs.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2000, 2002, 2003 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 _MIPS_LDSODEFS_H -#define _MIPS_LDSODEFS_H - -/* The MIPS ABI specifies that the dynamic section has to be read-only. */ - -#define DL_RO_DYN_SECTION 1 - -#include_next <ldsodefs.h> - -/* The 64-bit MIPS ELF ABI uses an unusual reloc format. Each - relocation entry specifies up to three actual relocations, all at - the same address. The first relocation which required a symbol - uses the symbol in the r_sym field. The second relocation which - requires a symbol uses the symbol in the r_ssym field. If all - three relocations require a symbol, the third one uses a zero - value. - - We define these structures in internal headers because we're not - sure we want to make them part of the ABI yet. Eventually, some of - this may move into elf/elf.h. */ - -/* An entry in a 64 bit SHT_REL section. */ - -typedef struct -{ - Elf32_Word r_sym; /* Symbol index */ - unsigned char r_ssym; /* Special symbol for 2nd relocation */ - unsigned char r_type3; /* 3rd relocation type */ - unsigned char r_type2; /* 2nd relocation type */ - unsigned char r_type1; /* 1st relocation type */ -} _Elf64_Mips_R_Info; - -typedef union -{ - Elf64_Xword r_info_number; - _Elf64_Mips_R_Info r_info_fields; -} _Elf64_Mips_R_Info_union; - -typedef struct -{ - Elf64_Addr r_offset; /* Address */ - _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ -} Elf64_Mips_Rel; - -typedef struct -{ - Elf64_Addr r_offset; /* Address */ - _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ - Elf64_Sxword r_addend; /* Addend */ -} Elf64_Mips_Rela; - -#define ELF64_MIPS_R_SYM(i) \ - ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) -#define ELF64_MIPS_R_TYPE(i) \ - (((_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1 \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_type2 << 8) \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_type3 << 16) \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_ssym << 24)) -#define ELF64_MIPS_R_INFO(sym, type) \ - (__extension__ (_Elf64_Mips_R_Info_union) \ - (__extension__ (_Elf64_Mips_R_Info) \ - { (sym), ELF64_MIPS_R_SSYM (type), \ - ELF64_MIPS_R_TYPE3 (type), \ - ELF64_MIPS_R_TYPE2 (type), \ - ELF64_MIPS_R_TYPE1 (type) \ - }).r_info_number) -/* These macros decompose the value returned by ELF64_MIPS_R_TYPE, and - compose it back into a value that it can be used as an argument to - ELF64_MIPS_R_INFO. */ -#define ELF64_MIPS_R_SSYM(i) (((i) >> 24) & 0xff) -#define ELF64_MIPS_R_TYPE3(i) (((i) >> 16) & 0xff) -#define ELF64_MIPS_R_TYPE2(i) (((i) >> 8) & 0xff) -#define ELF64_MIPS_R_TYPE1(i) ((i) & 0xff) -#define ELF64_MIPS_R_TYPEENC(type1, type2, type3, ssym) \ - ((type1) \ - | ((Elf32_Word)(type2) << 8) \ - | ((Elf32_Word)(type3) << 16) \ - | ((Elf32_Word)(ssym) << 24)) - -#undef ELF64_R_SYM -#define ELF64_R_SYM(i) ELF64_MIPS_R_SYM (i) -#undef ELF64_R_TYPE -#define ELF64_R_TYPE(i) ELF64_MIPS_R_TYPE (i) -#undef ELF64_R_INFO -#define ELF64_R_INFO(sym, type) ELF64_MIPS_R_INFO ((sym), (type)) - -#endif diff --git a/sysdeps/mips/elf/start.S b/sysdeps/mips/elf/start.S deleted file mode 100644 index d9cc3b7ee2..0000000000 --- a/sysdeps/mips/elf/start.S +++ /dev/null @@ -1,119 +0,0 @@ -/* Startup code compliant to the ELF Mips ABI. - Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004 - 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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 __ASSEMBLY__ 1 -#include <entry.h> -#include <sgidefs.h> -#include <sys/asm.h> - -#ifndef ENTRY_POINT -#error ENTRY_POINT needs to be defined for start.S on MIPS/ELF. -#endif - -/* This is the canonical entry point, usually the first thing in the text - segment. The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry - point runs, most registers' values are unspecified, except for: - - v0 ($2) Contains a function pointer to be registered with `atexit'. - This is how the dynamic linker arranges to have DT_FINI - functions called for shared libraries that have been loaded - before this code runs. - - sp ($29) The stack contains the arguments and environment: - 0(%esp) argc - 4(%esp) argv[0] - ... - (4*argc)(%esp) NULL - (4*(argc+1))(%esp) envp[0] - ... - NULL - ra ($31) The return address register is set to zero so that programs - that search backword through stack frames recognize the last - stack frame. -*/ - - -/* We need to call: - __libc_start_main (int (*main) (int, char **, char **), int argc, - char **argv, void (*init) (void), void (*fini) (void), - void (*rtld_fini) (void), void *stack_end) -*/ - - .text - .globl ENTRY_POINT - .type ENTRY_POINT,@function -ENTRY_POINT: -#ifdef __PIC__ - SETUP_GPX($0) - SETUP_GPX64($25,$0) -#else - PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */ - move $31, $0 -#endif - - PTR_LA $4, main /* main */ - PTR_L $5, 0($29) /* argc */ - PTR_ADDIU $6, $29, PTRSIZE /* argv */ - - /* Allocate space on the stack for seven arguments (o32 only) - and make sure the stack is aligned to double words (8 bytes) - on o32 and quad words (16 bytes) on n32 and n64. */ - - and $29, -2 * SZREG -#if _MIPS_SIM == _ABIO32 - PTR_SUBIU $29, 32 -#endif - PTR_LA $7, __libc_csu_init /* init */ - PTR_LA $8, __libc_csu_fini -#if _MIPS_SIM == _ABIO32 - PTR_S $8, 16($29) /* fini */ - PTR_S $2, 20($29) /* rtld_fini */ - PTR_S $29, 24($29) /* stack_end */ -#else - move $9, $2 /* rtld_fini */ - move $10, $29 /* stack_end */ -#endif - jal __libc_start_main -hlt: b hlt /* Crash if somehow it does return. */ - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/sysdeps/mips/fpregdef.h b/sysdeps/mips/fpregdef.h deleted file mode 100644 index 6f76d1183d..0000000000 --- a/sysdeps/mips/fpregdef.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 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 _FPREGDEF_H -#define _FPREGDEF_H - -#include <sys/fpregdef.h> - -#endif /* _FPREGDEF_H */ diff --git a/sysdeps/mips/fpu/e_sqrt.c b/sysdeps/mips/fpu/e_sqrt.c deleted file mode 100644 index 5449710aff..0000000000 --- a/sysdeps/mips/fpu/e_sqrt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <sgidefs.h> - - -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) - -double -__ieee754_sqrt (double x) -{ - double z; - __asm__ ("sqrt.d %0,%1" : "=f" (z) : "f" (x)); - return z; -} - -#else - -#include <sysdeps/ieee754/dbl-64/e_sqrt.c> - -#endif diff --git a/sysdeps/mips/fpu/e_sqrtf.c b/sysdeps/mips/fpu/e_sqrtf.c deleted file mode 100644 index 3590ad46d5..0000000000 --- a/sysdeps/mips/fpu/e_sqrtf.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <sgidefs.h> - - -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) - -float -__ieee754_sqrtf (float x) -{ - float z; - __asm__ ("sqrt.s %0,%1" : "=f" (z) : "f" (x)); - return z; -} - -#else - -#include <sysdeps/ieee754/flt-32/e_sqrtf.c> - -#endif - diff --git a/sysdeps/mips/fpu/fclrexcpt.c b/sysdeps/mips/fpu/fclrexcpt.c deleted file mode 100644 index f773312b34..0000000000 --- a/sysdeps/mips/fpu/fclrexcpt.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - 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 <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feclearexcept (int excepts) -{ - int cw; - - /* Mask out unsupported bits/exceptions. */ - excepts &= FE_ALL_EXCEPT; - - /* Read the complete control word. */ - _FPU_GETCW (cw); - - /* Clear exception flag bits and cause bits. If the cause bit is not - cleared, the next CTC instruction (just below) will re-generate the - exception. */ - - cw &= ~(excepts | (excepts << CAUSE_SHIFT)); - - /* Put the new data in effect. */ - _FPU_SETCW (cw); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fedisblxcpt.c b/sysdeps/mips/fpu/fedisblxcpt.c deleted file mode 100644 index 62e1a7130a..0000000000 --- a/sysdeps/mips/fpu/fedisblxcpt.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -fedisableexcept (int excepts) -{ - unsigned int new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc &= ~(excepts << ENABLE_SHIFT); - new_exc &= ~_FPU_RESERVED; - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/sysdeps/mips/fpu/feenablxcpt.c b/sysdeps/mips/fpu/feenablxcpt.c deleted file mode 100644 index 4c285811db..0000000000 --- a/sysdeps/mips/fpu/feenablxcpt.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feenableexcept (int excepts) -{ - unsigned int new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc |= excepts << ENABLE_SHIFT; - new_exc &= ~_FPU_RESERVED; - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/sysdeps/mips/fpu/fegetenv.c b/sysdeps/mips/fpu/fegetenv.c deleted file mode 100644 index c1741385fd..0000000000 --- a/sysdeps/mips/fpu/fegetenv.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Store current floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fegetenv (fenv_t *envp) -{ - _FPU_GETCW (*envp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fegetexcept.c b/sysdeps/mips/fpu/fegetexcept.c deleted file mode 100644 index 14b1241294..0000000000 --- a/sysdeps/mips/fpu/fegetexcept.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -fegetexcept (void) -{ - unsigned int exc; - - /* Get the current control word. */ - _FPU_GETCW (exc); - - return (exc & ENABLE_MASK) >> ENABLE_SHIFT; -} diff --git a/sysdeps/mips/fpu/fegetround.c b/sysdeps/mips/fpu/fegetround.c deleted file mode 100644 index efb1ba0dcc..0000000000 --- a/sysdeps/mips/fpu/fegetround.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Return current rounding direction. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fegetround (void) -{ - int cw; - - /* Get control word. */ - _FPU_GETCW (cw); - - return cw & 0x3; -} diff --git a/sysdeps/mips/fpu/feholdexcpt.c b/sysdeps/mips/fpu/feholdexcpt.c deleted file mode 100644 index bb37148fff..0000000000 --- a/sysdeps/mips/fpu/feholdexcpt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Store current floating-point environment and clear exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <fenv.h> -#include <fpu_control.h> - -int -feholdexcept (fenv_t *envp) -{ - fpu_control_t cw; - - /* Save the current state. */ - _FPU_GETCW (cw); - envp->__fp_control_register = cw; - - /* Clear all exception enable bits and flags. */ - cw &= ~(_FPU_MASK_V|_FPU_MASK_Z|_FPU_MASK_O|_FPU_MASK_U|_FPU_MASK_I|FE_ALL_EXCEPT); - _FPU_SETCW (cw); - - return 0; -} diff --git a/sysdeps/mips/fpu/fenv_libc.h b/sysdeps/mips/fpu/fenv_libc.h deleted file mode 100644 index d971d2c711..0000000000 --- a/sysdeps/mips/fpu/fenv_libc.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>. - - 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_LIBC_H -#define _FENV_LIBC_H 1 - -/* Mask for enabling exceptions and for the CAUSE bits. */ -#define ENABLE_MASK 0x00F80U -#define CAUSE_MASK 0x1F000U - -/* Shift for FE_* flags to get up to the ENABLE bits and the CAUSE bits. */ -#define ENABLE_SHIFT 5 -#define CAUSE_SHIFT 10 - - -#endif /* _FENV_LIBC_H */ diff --git a/sysdeps/mips/fpu/fesetenv.c b/sysdeps/mips/fpu/fesetenv.c deleted file mode 100644 index b71a877ae3..0000000000 --- a/sysdeps/mips/fpu/fesetenv.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fesetenv (const fenv_t *envp) -{ - fpu_control_t cw; - - /* Read first current state to flush fpu pipeline. */ - _FPU_GETCW (cw); - - if (envp == FE_DFL_ENV) - _FPU_SETCW (_FPU_DEFAULT); - else if (envp == FE_NOMASK_ENV) - _FPU_SETCW (_FPU_IEEE); - else - _FPU_SETCW (envp->__fp_control_register); - - /* Success. */ - return 0; -} - -libm_hidden_def (fesetenv) diff --git a/sysdeps/mips/fpu/fesetround.c b/sysdeps/mips/fpu/fesetround.c deleted file mode 100644 index af73a720f8..0000000000 --- a/sysdeps/mips/fpu/fesetround.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fesetround (int round) -{ - unsigned short int cw; - - if ((round & ~0x3) != 0) - /* ROUND is no valid rounding mode. */ - return 1; - - /* Get current state. */ - _FPU_GETCW (cw); - - /* Set rounding bits. */ - cw &= ~0x3; - cw |= round; - /* Set new state. */ - _FPU_SETCW (cw); - - return 0; -} diff --git a/sysdeps/mips/fpu/feupdateenv.c b/sysdeps/mips/fpu/feupdateenv.c deleted file mode 100644 index 20b20e14c0..0000000000 --- a/sysdeps/mips/fpu/feupdateenv.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -feupdateenv (const fenv_t *envp) -{ - int temp; - - /* Save current exceptions. */ - _FPU_GETCW (temp); - temp &= FE_ALL_EXCEPT; - - /* Install new environment. */ - fesetenv (envp); - - /* Raise the safed exception. Incidently for us the implementation - defined format of the values in objects of type fexcept_t is the - same as the ones specified using the FE_* constants. */ - feraiseexcept (temp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fgetexcptflg.c b/sysdeps/mips/fpu/fgetexcptflg.c deleted file mode 100644 index 3412159816..0000000000 --- a/sysdeps/mips/fpu/fgetexcptflg.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fegetexceptflag (fexcept_t *flagp, int excepts) -{ - fexcept_t temp; - - /* Get the current exceptions. */ - _FPU_GETCW (temp); - - /* We only save the relevant bits here. In particular, care has to be - taken with the CAUSE bits, as an inadvertent restore later on could - generate unexpected exceptions. */ - - *flagp = temp & excepts & FE_ALL_EXCEPT; - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fraiseexcpt.c b/sysdeps/mips/fpu/fraiseexcpt.c deleted file mode 100644 index 3e2ebe0fe7..0000000000 --- a/sysdeps/mips/fpu/fraiseexcpt.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feraiseexcept (int excepts) -{ - fpu_control_t cw; - - /* Get current state. */ - _FPU_GETCW (cw); - - /* Set flag bits (which are accumulative), and *also* set the - cause bits. The setting of the cause bits is what actually causes - the hardware to generate the exception, if the corresponding enable - bit is set as well. */ - - excepts &= FE_ALL_EXCEPT; - cw |= excepts | (excepts << CAUSE_SHIFT); - - /* Set new state. */ - _FPU_SETCW (cw); - - return 0; -} - -libm_hidden_def (feraiseexcept) diff --git a/sysdeps/mips/fpu/fsetexcptflg.c b/sysdeps/mips/fpu/fsetexcptflg.c deleted file mode 100644 index c65d793178..0000000000 --- a/sysdeps/mips/fpu/fsetexcptflg.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <fenv.h> -#include <fpu_control.h> - -int -fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - fexcept_t temp; - - /* Get the current exceptions. */ - _FPU_GETCW (temp); - - /* Make sure the flags we want restored are legal. */ - excepts &= FE_ALL_EXCEPT; - - /* Now clear the bits called for, and copy them in from flagp. Note that - we ignore all non-flag bits from *flagp, so they don't matter. */ - temp = (temp & ~excepts) | (*flagp & excepts); - - _FPU_SETCW (temp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/ftestexcept.c b/sysdeps/mips/fpu/ftestexcept.c deleted file mode 100644 index 6a833f7563..0000000000 --- a/sysdeps/mips/fpu/ftestexcept.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Test exception in current environment. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - 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 <fenv.h> -#include <fpu_control.h> - -int -fetestexcept (int excepts) -{ - int cw; - - /* Get current control word. */ - _FPU_GETCW (cw); - - return cw & excepts & FE_ALL_EXCEPT; -} diff --git a/sysdeps/mips/fpu/libm-test-ulps b/sysdeps/mips/fpu/libm-test-ulps deleted file mode 100644 index b514496676..0000000000 --- a/sysdeps/mips/fpu/libm-test-ulps +++ /dev/null @@ -1,890 +0,0 @@ -# Begin of automatic generation - -# atan2 -Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": -float: 1 -ifloat: 1 - -# atanh -Test "atanh (0.75) == 0.972955074527656652552676371721589865": -float: 1 -ifloat: 1 - -# cacosh -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -# casin -Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# casinh -Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 -Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 -Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# catan -Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -float: 3 -ifloat: 3 -Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i": -float: 4 -ifloat: 4 - -# catanh -Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -double: 4 -idouble: 4 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -float: 4 -ifloat: 4 -Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -double: 1 -idouble: 1 -Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -float: 6 -ifloat: 6 - -# cbrt -Test "cbrt (-27.0) == -3.0": -double: 1 -idouble: 1 -Test "cbrt (0.75) == 0.908560296416069829445605878163630251": -double: 1 -idouble: 1 -Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217": -double: 1 -idouble: 1 - -# ccos -Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": -float: 1 -ifloat: 1 -Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -float: 1 -ifloat: 1 - -# ccosh -Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -float: 1 -ifloat: 1 - -# cexp -Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": -float: 1 -ifloat: 1 -Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -float: 1 -ifloat: 1 - -# clog -Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i": -float: 3 -ifloat: 3 -Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -float: 1 -ifloat: 1 - -# clog10 -Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": -float: 1 -ifloat: 1 - -# cos -Test "cos (M_PI_6l * 2.0) == 0.5": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "cos (M_PI_6l * 4.0) == -0.5": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "cos (pi/2) == 0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# cpow -Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": -double: 2 -float: 3 -idouble: 2 -ifloat: 3 -Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -float: 2 -ifloat: 2 -Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -# csinh -Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": -double: 1 -idouble: 1 -Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 - -# csqrt -Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 -Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 - -# ctan -Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": -double: 1 -idouble: 1 -Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -double: 1 -idouble: 1 - -# ctanh -Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": -float: 1 -ifloat: 1 -Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": -double: 1 -idouble: 1 - -# erf -Test "erf (1.25) == 0.922900128256458230136523481197281140": -double: 1 -idouble: 1 - -# erfc -Test "erfc (2.0) == 0.00467773498104726583793074363274707139": -double: 1 -idouble: 1 -Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": -double: 1 -idouble: 1 - -# exp10 -Test "exp10 (-1) == 0.1": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "exp10 (0.75) == 5.62341325190349080394951039776481231": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "exp10 (3) == 1000": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -# expm1 -Test "expm1 (0.75) == 1.11700001661267466854536981983709561": -double: 1 -idouble: 1 -Test "expm1 (1) == M_El - 1.0": -float: 1 -ifloat: 1 - -# hypot -Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 - -# j0 -Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "j0 (10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "j0 (2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 - -# j1 -Test "j1 (10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "j1 (2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "j1 (8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 - -# jn -Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 -Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 -Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": -double: 4 -float: 3 -idouble: 4 -ifloat: 3 -Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": -float: 4 -ifloat: 4 -Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# lgamma -Test "lgamma (0.7) == 0.260867246531666514385732417016759578": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# log10 -Test "log10 (0.75) == -0.124938736608299953132449886193870744": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "log10 (e) == log10(e)": -float: 1 -ifloat: 1 - -# log1p -Test "log1p (-0.25) == -0.287682072451780927439219005993827432": -float: 1 -ifloat: 1 - -# sincos -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": -float: 1 -ifloat: 1 - -# tan -Test "tan (pi/4) == 1": -double: 1 -idouble: 1 - -# tgamma -Test "tgamma (-0.5) == -2 sqrt (pi)": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "tgamma (0.5) == sqrt (pi)": -float: 1 -ifloat: 1 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y0 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "y0 (8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y1 -Test "y1 (0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "y1 (1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "y1 (10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "y1 (2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "y1 (8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# yn -Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "yn (1, 1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "yn (10, 0.125) == -127057845771019398.252538486899753195": -double: 1 -idouble: 1 -Test "yn (10, 0.75) == -2133501638.90573424452445412893839236": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 1.0) == -121618014.278689189288130426667971145": -double: 1 -idouble: 1 -Test "yn (10, 10.0) == -0.359814152183402722051986577343560609": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 2.0) == -129184.542208039282635913145923304214": -double: 2 -idouble: 2 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": -double: 1 -idouble: 1 -Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": -double: 1 -idouble: 1 - -# Maximal error of functions: -Function: "atan2": -float: 3 -ifloat: 3 - -Function: "atanh": -float: 1 -ifloat: 1 - -Function: Real part of "cacosh": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 - -Function: Imaginary part of "cacosh": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -Function: Real part of "casin": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "casinh": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 - -Function: Imaginary part of "casinh": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 - -Function: Real part of "catan": -float: 4 -ifloat: 4 - -Function: Imaginary part of "catan": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "catanh": -double: 4 -idouble: 4 - -Function: Imaginary part of "catanh": -float: 6 -ifloat: 6 - -Function: "cbrt": -double: 1 -idouble: 1 - -Function: Real part of "ccos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccos": -float: 1 -ifloat: 1 - -Function: Real part of "ccosh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccosh": -float: 1 -ifloat: 1 - -Function: Real part of "cexp": -float: 1 -ifloat: 1 - -Function: Imaginary part of "cexp": -float: 1 -ifloat: 1 - -Function: Real part of "clog": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog": -float: 3 -ifloat: 3 - -Function: Real part of "clog10": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog10": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 - -Function: "cos": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: Real part of "cpow": -double: 2 -float: 4 -idouble: 2 -ifloat: 4 - -Function: Imaginary part of "cpow": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: Real part of "csinh": -float: 1 -ifloat: 1 - -Function: Imaginary part of "csinh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "csqrt": -float: 1 -ifloat: 1 - -Function: Real part of "ctan": -double: 1 -idouble: 1 - -Function: Imaginary part of "ctan": -double: 1 -idouble: 1 - -Function: Real part of "ctanh": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: Imaginary part of "ctanh": -float: 1 -ifloat: 1 - -Function: "erf": -double: 1 -idouble: 1 - -Function: "erfc": -double: 1 -idouble: 1 - -Function: "exp10": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -Function: "expm1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "hypot": -float: 1 -ifloat: 1 - -Function: "j0": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: "j1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "jn": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 - -Function: "lgamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log10": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log1p": -float: 1 -ifloat: 1 - -Function: "sincos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "tan": -double: 1 -idouble: 1 - -Function: "tgamma": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "y0": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: "y1": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -Function: "yn": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -# end of automatic generation diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h deleted file mode 100644 index da18deab5a..0000000000 --- a/sysdeps/mips/fpu_control.h +++ /dev/null @@ -1,98 +0,0 @@ -/* FPU control word bits. Mips version. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Olaf Flebbe and Ralf Baechle. - - 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 _FPU_CONTROL_H -#define _FPU_CONTROL_H - -/* MIPS FPU floating point control register bits. - * - * 31-25 -> floating point conditions code bits 7-1. These bits are only - * available in MIPS IV. - * 24 -> flush denormalized results to zero instead of - * causing unimplemented operation exception. This bit is only - * available for MIPS III and newer. - * 23 -> Condition bit - * 22-18 -> reserved (read as 0, write with 0) - * 17 -> cause bit for unimplemented operation - * 16 -> cause bit for invalid exception - * 15 -> cause bit for division by zero exception - * 14 -> cause bit for overflow exception - * 13 -> cause bit for underflow exception - * 12 -> cause bit for inexact exception - * 11 -> enable exception for invalid exception - * 10 -> enable exception for division by zero exception - * 9 -> enable exception for overflow exception - * 8 -> enable exception for underflow exception - * 7 -> enable exception for inexact exception - * 6 -> flag invalid exception - * 5 -> flag division by zero exception - * 4 -> flag overflow exception - * 3 -> flag underflow exception - * 2 -> flag inexact exception - * 1-0 -> rounding control - * - * - * Rounding Control: - * 00 - rounding to nearest (RN) - * 01 - rounding toward zero (RZ) - * 10 - rounding (up) toward plus infinity (RP) - * 11 - rounding (down)toward minus infinity (RM) - */ - -#include <features.h> - -/* masking of interrupts */ -#define _FPU_MASK_V 0x0800 /* Invalid operation */ -#define _FPU_MASK_Z 0x0400 /* Division by zero */ -#define _FPU_MASK_O 0x0200 /* Overflow */ -#define _FPU_MASK_U 0x0100 /* Underflow */ -#define _FPU_MASK_I 0x0080 /* Inexact operation */ - -/* flush denormalized numbers to zero */ -#define _FPU_FLUSH_TZ 0x1000000 - -/* rounding control */ -#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RC_ZERO 0x1 -#define _FPU_RC_UP 0x2 -#define _FPU_RC_DOWN 0x3 - -#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */ - - -/* The fdlibm code requires strict IEEE double precision arithmetic, - and no interrupts for exceptions, rounding to nearest. */ - -#define _FPU_DEFAULT 0x00000000 - -/* IEEE: same as above, but exceptions */ -#define _FPU_IEEE 0x00000F80 - -/* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); - -/* Macros for accessing the hardware control word. */ -#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw)) -#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw)) - -/* Default control word set at startup. */ -extern fpu_control_t __fpu_control; - -#endif /* fpu_control.h */ diff --git a/sysdeps/mips/gccframe.h b/sysdeps/mips/gccframe.h deleted file mode 100644 index ec9311caca..0000000000 --- a/sysdeps/mips/gccframe.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Definition of object in frame unwind info. mips version. - Copyright (C) 2001 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 FIRST_PSEUDO_REGISTER 76 - -#include <sysdeps/generic/gccframe.h> diff --git a/sysdeps/mips/ieee754.h b/sysdeps/mips/ieee754.h deleted file mode 100644 index ed13de2775..0000000000 --- a/sysdeps/mips/ieee754.h +++ /dev/null @@ -1,325 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1999, 2002, 2003 - 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 _IEEE754_H - -#define _IEEE754_H 1 -#include <features.h> - -#include <endian.h> - -#include <float.h> - -__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 -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#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 -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; - 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 -#endif - } ieee_nan; - }; - -#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - -#if LDBL_MANT_DIG == 113 - -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; -#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:15; - unsigned int quiet_nan:1; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ - -#elif LDBL_MANT_DIG == 64 - -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 double-extended-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int empty:16; - unsigned int mantissa0:32; - unsigned int mantissa1:32; -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; - unsigned int mantissa0:32; - unsigned int mantissa1:32; -# else - unsigned int mantissa1:32; - unsigned int mantissa0:32; - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; -# endif -#endif - } ieee; - - /* This is for NaNs in the IEEE 854 double-extended-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int empty:16; - unsigned int one:1; - unsigned int quiet_nan:1; - unsigned int mantissa0:30; - unsigned int mantissa1:32; -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; - unsigned int mantissa0:30; - unsigned int quiet_nan:1; - unsigned int one:1; - unsigned int mantissa1:32; -# else - unsigned int mantissa1:32; - unsigned int mantissa0:30; - unsigned int quiet_nan:1; - unsigned int one:1; - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; -# endif -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff - -#elif LDBL_MANT_DIG == 53 - -union ieee854_long_double - { - long 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 -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#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 -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; - 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 -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - -#endif /* LDBL_MANT_DIG == 53 */ - -__END_DECLS - -#endif /* ieee754.h */ diff --git a/sysdeps/mips/init-first.c b/sysdeps/mips/init-first.c deleted file mode 100644 index b67a44431c..0000000000 --- a/sysdeps/mips/init-first.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. For mips/Unix. - Copyright (C) 1996, 1997 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 <unistd.h> - -extern void __libc_init (int, char **, char **); -extern void __libc_global_ctors (void); - - -static void -init (int *data) -{ - int argc = *data; - char **argv = (void *) (data + 1); - char **envp = &argv[argc + 1]; - - __environ = envp; - __libc_init (argc, argv, envp); -} - -#ifdef SHARED -/* This function is called to initialize the shared C library. - It is called just before the user _start code from mips/elf/start.S, - with the stack set up as that code gets it. */ - -/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT - pointer in the dynamic section based solely on that. It is convention - for this function to be in the `.init' section, but the symbol name is - the only thing that really matters!! */ -/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ - -void -_init (int argc, ...) -{ - init (&argc); - - __libc_global_ctors (); -} -#endif - - -void -__libc_init_first (int argc __attribute__ ((unused)), ...) -{ -#ifndef SHARED - init (&argc); -#endif -} diff --git a/sysdeps/mips/jmpbuf-unwind.h b/sysdeps/mips/jmpbuf-unwind.h deleted file mode 100644 index bfa1a64537..0000000000 --- a/sysdeps/mips/jmpbuf-unwind.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2003, 2005, 2006 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 <setjmp.h> -#include <stdint.h> -#include <unwind.h> -#include <sysdep.h> - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp)) - -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) - -static inline uintptr_t __attribute__ ((unused)) -_jmpbuf_sp (__jmp_buf regs) -{ - uintptr_t sp = regs[0].__sp; -#ifdef PTR_DEMANGLE - PTR_DEMANGLE (sp); -#endif - return sp; -} - -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ - ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) - -/* We use the normal longjmp for unwinding. */ -#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val) diff --git a/sysdeps/mips/lshift.S b/sysdeps/mips/lshift.S deleted file mode 100644 index 0217bfc586..0000000000 --- a/sysdeps/mips/lshift.S +++ /dev/null @@ -1,98 +0,0 @@ -/* MIPS2 __mpn_lshift -- - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - src_ptr $5 - size $6 - cnt $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_lshift) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - sll $2,$6,2 - addu $5,$5,$2 /* make r5 point at end of src */ - lw $10,-4($5) /* load first limb */ - subu $13,$0,$7 - addu $4,$4,$2 /* make r4 point at end of res */ - addiu $6,$6,-1 - and $9,$6,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - srl $2,$10,$13 /* compute function result */ - - subu $6,$6,$9 - -L(Loop0): lw $3,-8($5) - addiu $4,$4,-4 - addiu $5,$5,-4 - addiu $9,$9,-1 - sll $11,$10,$7 - srl $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sw $8,0($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): lw $3,-8($5) - addiu $4,$4,-16 - addiu $6,$6,-4 - sll $11,$10,$7 - srl $12,$3,$13 - - lw $10,-12($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,12($4) - srl $9,$10,$13 - - lw $3,-16($5) - sll $11,$10,$7 - or $8,$14,$9 - sw $8,8($4) - srl $12,$3,$13 - - lw $10,-20($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,4($4) - srl $9,$10,$13 - - addiu $5,$5,-16 - or $8,$14,$9 - bgtz $6,L(Loop) - sw $8,0($4) - -L(Lend): sll $8,$10,$7 - j $31 - sw $8,-4($4) - END (__mpn_lshift) diff --git a/sysdeps/mips/machine-gmon.h b/sysdeps/mips/machine-gmon.h deleted file mode 100644 index 7a089fa595..0000000000 --- a/sysdeps/mips/machine-gmon.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Machine-specific calling sequence for `mcount' profiling function. MIPS - Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 - 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 <sgidefs.h> - -#define _MCOUNT_DECL(frompc,selfpc) \ -static void __attribute_used__ __mcount (u_long frompc, u_long selfpc) - -/* Call __mcount with the return PC for our caller, - and the return PC our caller will return to. */ - -#if _MIPS_SIM == _ABIO32 - -#ifdef __PIC__ -# define CPLOAD ".cpload $25;" -# define CPRESTORE ".cprestore 44\n\t" -#else -# define CPLOAD -# define CPRESTORE -#endif - -#define MCOUNT asm(\ - ".globl _mcount;\n\t" \ - ".align 2;\n\t" \ - ".type _mcount,@function;\n\t" \ - ".ent _mcount\n\t" \ - "_mcount:\n\t" \ - ".frame $sp,44,$31\n\t" \ - ".set noreorder;\n\t" \ - ".set noat;\n\t" \ - CPLOAD \ - "subu $29,$29,48;\n\t" \ - CPRESTORE \ - "sw $4,24($29);\n\t" \ - "sw $5,28($29);\n\t" \ - "sw $6,32($29);\n\t" \ - "sw $7,36($29);\n\t" \ - "sw $2,40($29);\n\t" \ - "sw $1,16($29);\n\t" \ - "sw $31,20($29);\n\t" \ - "move $5,$31;\n\t" \ - "move $4,$1;\n\t" \ - "jal __mcount;\n\t" \ - "nop;\n\t" \ - "lw $4,24($29);\n\t" \ - "lw $5,28($29);\n\t" \ - "lw $6,32($29);\n\t" \ - "lw $7,36($29);\n\t" \ - "lw $2,40($29);\n\t" \ - "lw $31,20($29);\n\t" \ - "lw $1,16($29);\n\t" \ - "addu $29,$29,56;\n\t" \ - "j $31;\n\t" \ - "move $31,$1;\n\t" \ - ".set reorder;\n\t" \ - ".set at\n\t" \ - ".end _mcount"); - -#else - -#ifdef __PIC__ -# define CPSETUP ".cpsetup $25, 88, _mcount;" -# define CPRETURN ".cpreturn;" -#else -# define CPSETUP -# define CPRETURN -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADDU_STRING "add" /* no u */ -# define PTR_SUBU_STRING "sub" /* no u */ -#elif _MIPS_SIM == _ABI64 -# define PTR_ADDU_STRING "daddu" -# define PTR_SUBU_STRING "dsubu" -#else -# error "Unknown ABI" -#endif - -#define MCOUNT asm(\ - ".globl _mcount;\n\t" \ - ".align 3;\n\t" \ - ".type _mcount,@function;\n\t" \ - ".ent _mcount\n\t" \ - "_mcount:\n\t" \ - ".frame $sp,88,$31\n\t" \ - ".set noreorder;\n\t" \ - ".set noat;\n\t" \ - PTR_SUBU_STRING " $29,$29,96;\n\t" \ - CPSETUP \ - "sd $4,24($29);\n\t" \ - "sd $5,32($29);\n\t" \ - "sd $6,40($29);\n\t" \ - "sd $7,48($29);\n\t" \ - "sd $8,56($29);\n\t" \ - "sd $9,64($29);\n\t" \ - "sd $10,72($29);\n\t" \ - "sd $11,80($29);\n\t" \ - "sd $2,16($29);\n\t" \ - "sd $1,0($29);\n\t" \ - "sd $31,8($29);\n\t" \ - "move $5,$31;\n\t" \ - "move $4,$1;\n\t" \ - "jal __mcount;\n\t" \ - "nop;\n\t" \ - "ld $4,24($29);\n\t" \ - "ld $5,32($29);\n\t" \ - "ld $6,40($29);\n\t" \ - "ld $7,48($29);\n\t" \ - "ld $8,56($29);\n\t" \ - "ld $9,64($29);\n\t" \ - "ld $10,72($29);\n\t" \ - "ld $11,80($29);\n\t" \ - "ld $2,16($29);\n\t" \ - "ld $31,8($29);\n\t" \ - "ld $1,0($29);\n\t" \ - CPRETURN \ - PTR_ADDU_STRING " $29,$29,96;\n\t" \ - "j $31;\n\t" \ - "move $31,$1;\n\t" \ - ".set reorder;\n\t" \ - ".set at\n\t" \ - ".end _mcount"); - -#endif diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S deleted file mode 100644 index 2049d05829..0000000000 --- a/sysdeps/mips/memcpy.S +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <sysdep.h> -#include <endian.h> - - -/* void *memcpy(void *s1, const void *s2, size_t n); */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define LWHI lwl /* high part is left in big-endian */ -# define SWHI swl /* high part is left in big-endian */ -# define LWLO lwr /* low part is right in big-endian */ -# define SWLO swr /* low part is right in big-endian */ -#else -# define LWHI lwr /* high part is right in little-endian */ -# define SWHI swr /* high part is right in little-endian */ -# define LWLO lwl /* low part is left in little-endian */ -# define SWLO swl /* low part is left in little-endian */ -#endif - -ENTRY (memcpy) - .set noreorder - - slti t0, a2, 8 # Less than 8? - bne t0, zero, L(last8) - move v0, a0 # Setup exit value before too late - - xor t0, a1, a0 # Find a0/a1 displacement - andi t0, 0x3 - bne t0, zero, L(shift) # Go handle the unaligned case - subu t1, zero, a1 - andi t1, 0x3 # a0/a1 are aligned, but are we - beq t1, zero, L(chk8w) # starting in the middle of a word? - subu a2, t1 - LWHI t0, 0(a1) # Yes we are... take care of that - addu a1, t1 - SWHI t0, 0(a0) - addu a0, t1 - -L(chk8w): - andi t0, a2, 0x1f # 32 or more bytes left? - beq t0, a2, L(chk1w) - subu a3, a2, t0 # Yes - addu a3, a1 # a3 = end address of loop - move a2, t0 # a2 = what will be left after loop -L(lop8w): - lw t0, 0(a1) # Loop taking 8 words at a time - lw t1, 4(a1) - lw t2, 8(a1) - lw t3, 12(a1) - lw t4, 16(a1) - lw t5, 20(a1) - lw t6, 24(a1) - lw t7, 28(a1) - addiu a0, 32 - addiu a1, 32 - sw t0, -32(a0) - sw t1, -28(a0) - sw t2, -24(a0) - sw t3, -20(a0) - sw t4, -16(a0) - sw t5, -12(a0) - sw t6, -8(a0) - bne a1, a3, L(lop8w) - sw t7, -4(a0) - -L(chk1w): - andi t0, a2, 0x3 # 4 or more bytes left? - beq t0, a2, L(last8) - subu a3, a2, t0 # Yes, handle them one word at a time - addu a3, a1 # a3 again end address - move a2, t0 -L(lop1w): - lw t0, 0(a1) - addiu a0, 4 - addiu a1, 4 - bne a1, a3, L(lop1w) - sw t0, -4(a0) - -L(last8): - blez a2, L(lst8e) # Handle last 8 bytes, one at a time - addu a3, a2, a1 -L(lst8l): - lb t0, 0(a1) - addiu a0, 1 - addiu a1, 1 - bne a1, a3, L(lst8l) - sb t0, -1(a0) -L(lst8e): - jr ra # Bye, bye - nop - -L(shift): - subu a3, zero, a0 # Src and Dest unaligned - andi a3, 0x3 # (unoptimized case...) - beq a3, zero, L(shft1) - subu a2, a3 # a2 = bytes left - LWHI t0, 0(a1) # Take care of first odd part - LWLO t0, 3(a1) - addu a1, a3 - SWHI t0, 0(a0) - addu a0, a3 -L(shft1): - andi t0, a2, 0x3 - subu a3, a2, t0 - addu a3, a1 -L(shfth): - LWHI t1, 0(a1) # Limp through, word by word - LWLO t1, 3(a1) - addiu a0, 4 - addiu a1, 4 - bne a1, a3, L(shfth) - sw t1, -4(a0) - b L(last8) # Handle anything which may be left - move a2, t0 - - .set reorder -END (memcpy) -libc_hidden_builtin_def (memcpy) diff --git a/sysdeps/mips/memset.S b/sysdeps/mips/memset.S deleted file mode 100644 index 694ee8f1dc..0000000000 --- a/sysdeps/mips/memset.S +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <sysdep.h> -#include <endian.h> - - -/* void *memset(void *s, int c, size_t n). */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define SWHI swl /* high part is left in big-endian */ -#else -# define SWHI swr /* high part is right in little-endian */ -#endif - -ENTRY (memset) - .set noreorder - - slti t1, a2, 8 # Less than 8? - bne t1, zero, L(last8) - move v0, a0 # Setup exit value before too late - - beq a1, zero, L(ueven) # If zero pattern, no need to extend - andi a1, 0xff # Avoid problems with bogus arguments - sll t0, a1, 8 - or a1, t0 - sll t0, a1, 16 - or a1, t0 # a1 is now pattern in full word - -L(ueven): - subu t0, zero, a0 # Unaligned address? - andi t0, 0x3 - beq t0, zero, L(chkw) - subu a2, t0 - SWHI a1, 0(a0) # Yes, handle first unaligned part - addu a0, t0 # Now both a0 and a2 are updated - -L(chkw): - andi t0, a2, 0x7 # Enough left for one loop iteration? - beq t0, a2, L(chkl) - subu a3, a2, t0 - addu a3, a0 # a3 is last loop address +1 - move a2, t0 # a2 is now # of bytes left after loop -L(loopw): - addiu a0, 8 # Handle 2 words pr. iteration - sw a1, -8(a0) - bne a0, a3, L(loopw) - sw a1, -4(a0) - -L(chkl): - andi t0, a2, 0x4 # Check if there is at least a full - beq t0, zero, L(last8) # word remaining after the loop - subu a2, t0 - sw a1, 0(a0) # Yes... - addiu a0, 4 - -L(last8): - blez a2, L(exit) # Handle last 8 bytes (if cnt>0) - addu a3, a2, a0 # a3 is last address +1 -L(lst8l): - addiu a0, 1 - bne a0, a3, L(lst8l) - sb a1, -1(a0) -L(exit): - j ra # Bye, bye - nop - - .set reorder -END (memset) -libc_hidden_builtin_def (memset) diff --git a/sysdeps/mips/memusage.h b/sysdeps/mips/memusage.h deleted file mode 100644 index dc1cc9ca14..0000000000 --- a/sysdeps/mips/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 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. */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("$29"); stack_ptr; }) - -#include <sysdeps/generic/memusage.h> diff --git a/sysdeps/mips/mips32/Implies b/sysdeps/mips/mips32/Implies deleted file mode 100644 index fab98d7312..0000000000 --- a/sysdeps/mips/mips32/Implies +++ /dev/null @@ -1,2 +0,0 @@ -mips -wordsize-32 diff --git a/sysdeps/mips/mips32/Makefile b/sysdeps/mips/mips32/Makefile deleted file mode 100644 index dec0b024c3..0000000000 --- a/sysdeps/mips/mips32/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(filter -mabi=32,$(CC)),) -CC += -mabi=32 -endif diff --git a/sysdeps/mips/mips64/Implies b/sysdeps/mips/mips64/Implies deleted file mode 100644 index 8c18cb3034..0000000000 --- a/sysdeps/mips/mips64/Implies +++ /dev/null @@ -1,3 +0,0 @@ -# MIPS uses IEEE 754 floating point. -ieee754/flt-32 -ieee754/dbl-64 diff --git a/sysdeps/mips/mips64/Versions b/sysdeps/mips/mips64/Versions deleted file mode 100644 index 253a65f04e..0000000000 --- a/sysdeps/mips/mips64/Versions +++ /dev/null @@ -1,7 +0,0 @@ -libm { - GLIBC_2.1 { - # A generic bug got this omitted from other configurations' version - # sets, but we always had it. - exp2l; - } -} diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c deleted file mode 100644 index 546493f842..0000000000 --- a/sysdeps/mips/mips64/__longjmp.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <setjmp.h> -#include <sgidefs.h> -#include <stdlib.h> - -#undef __longjmp - -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - -void -__longjmp (env, val_arg) - __jmp_buf env; - int val_arg; -{ - /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before - the hack around it); force it to use $a1 for the longjmp value. - Without this it saves $a1 in a register which gets clobbered - along the way. */ - register int val asm ("a1"); - - /* Pull back the floating point callee-saved registers. */ -#if _MIPS_SIM == _ABI64 - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f25, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f27, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f29, %0" : : "m" (env[0].__fpregs[5])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[6])); - asm volatile ("l.d $f31, %0" : : "m" (env[0].__fpregs[7])); -#else - asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); -#endif - - /* Get and reconstruct the floating point csr. */ - asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); - asm volatile ("ctc1 $2, $31"); - - /* Get the GP. */ - asm volatile ("ld $gp, %0" : : "m" (env[0].__gp)); - - /* Get the callee-saved registers. */ - asm volatile ("ld $16, %0" : : "m" (env[0].__regs[0])); - asm volatile ("ld $17, %0" : : "m" (env[0].__regs[1])); - asm volatile ("ld $18, %0" : : "m" (env[0].__regs[2])); - asm volatile ("ld $19, %0" : : "m" (env[0].__regs[3])); - asm volatile ("ld $20, %0" : : "m" (env[0].__regs[4])); - asm volatile ("ld $21, %0" : : "m" (env[0].__regs[5])); - asm volatile ("ld $22, %0" : : "m" (env[0].__regs[6])); - asm volatile ("ld $23, %0" : : "m" (env[0].__regs[7])); - - /* Get the PC. */ - asm volatile ("ld $31, %0" : : "m" (env[0].__pc)); - - - /* Restore the stack pointer and the FP. They have to be restored - last and in a single asm as gcc, depending on options used, may - use either of them to access env. */ - asm volatile ("ld $29, %0\n\t" - "ld $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); - -/* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ - if (val == 0) - asm volatile ("dli $2, 1"); - else - asm volatile ("move $2, %0" : : "r" (val)); - - asm volatile ("j $31"); - - /* Avoid `volatile function does return' warnings. */ - for (;;); -} diff --git a/sysdeps/mips/mips64/add_n.S b/sysdeps/mips/mips64/add_n.S deleted file mode 100644 index 072f4f0b73..0000000000 --- a/sysdeps/mips/mips64/add_n.S +++ /dev/null @@ -1,130 +0,0 @@ -/* MIPS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and - * store sum in a third limb vector. - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* - * INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * s2_ptr $6 - * size $7 - */ -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_add_n - .ent __mpn_add_n -__mpn_add_n: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) - ld $11,0($6) - - daddiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - move $2,$0 - - dsubu $7,$7,$9 - -L(Loop0): daddiu $9,$9,-1 - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - or $2,$2,$8 - - daddiu $5,$5,8 - daddiu $6,$6,8 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - daddiu $4,$4,8 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): daddiu $7,$7,-4 - - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - or $2,$2,$8 - - ld $10,16($5) - daddu $13,$13,$2 - ld $11,16($6) - sltu $8,$13,$2 - daddu $13,$12,$13 - sltu $2,$13,$12 - sd $13,8($4) - or $2,$2,$8 - - ld $12,24($5) - daddu $11,$11,$2 - ld $13,24($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,16($4) - or $2,$2,$8 - - ld $10,32($5) - daddu $13,$13,$2 - ld $11,32($6) - sltu $8,$13,$2 - daddu $13,$12,$13 - sltu $2,$13,$12 - sd $13,24($4) - or $2,$2,$8 - - daddiu $5,$5,32 - daddiu $6,$6,32 - - bne $7,$0,L(Loop) - daddiu $4,$4,32 - -L(Lend): daddu $11,$11,$2 - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_add_n diff --git a/sysdeps/mips/mips64/addmul_1.S b/sysdeps/mips/mips64/addmul_1.S deleted file mode 100644 index f5ecd83702..0000000000 --- a/sysdeps/mips/mips64/addmul_1.S +++ /dev/null @@ -1,107 +0,0 @@ -/* MIPS3 __mpn_addmul_1 -- Multiply a limb vector with a single limb and - * add the product to a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef PIC - .option pic2 -#endif - .text - .align 4 - .globl __mpn_addmul_1 - .ent __mpn_addmul_1 -__mpn_addmul_1: -#ifdef PIC - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): ld $10,0($4) - mflo $3 - mfhi $9 - daddiu $5,$5,8 - daddu $3,$3,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dmultu $8,$7 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_addmul_1 diff --git a/sysdeps/mips/mips64/bsd-_setjmp.S b/sysdeps/mips/mips64/bsd-_setjmp.S deleted file mode 100644 index 7620cf391f..0000000000 --- a/sysdeps/mips/mips64/bsd-_setjmp.S +++ /dev/null @@ -1,49 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version. - Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004 - 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 just does a tail-call to `__sigsetjmp (ARG, 0)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (_setjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp)) - PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 - move a1, zero /* Pass a second argument of zero. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end _setjmp -libc_hidden_def (_setjmp) diff --git a/sysdeps/mips/mips64/bsd-setjmp.S b/sysdeps/mips/mips64/bsd-setjmp.S deleted file mode 100644 index 2a1fd9ce71..0000000000 --- a/sysdeps/mips/mips64/bsd-setjmp.S +++ /dev/null @@ -1,47 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version. - Copyright (C) 1996, 1997, 2002, 2003, 2004 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 just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -#ifdef PIC - .option pic2 -#endif -ENTRY (setjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp)) - PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 - dli a1, 1 /* Pass a second argument of one. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end setjmp diff --git a/sysdeps/mips/mips64/gmp-mparam.h b/sysdeps/mips/mips64/gmp-mparam.h deleted file mode 100644 index 7666137a21..0000000000 --- a/sysdeps/mips/mips64/gmp-mparam.h +++ /dev/null @@ -1,31 +0,0 @@ -/* gmp-mparam.h -- Compiler/machine parameter header file. - -Copyright (C) 1991, 1993, 1994, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#if defined __GMP_H__ && ! defined _LONG_LONG_LIMB -#error "Included too late for _LONG_LONG_LIMB to take effect" -#endif - -#define _LONG_LONG_LIMB -#define BITS_PER_MP_LIMB 64 -#define BYTES_PER_MP_LIMB 8 -#define BITS_PER_LONGINT __WORDSIZE -#define BITS_PER_INT 32 -#define BITS_PER_SHORTINT 16 -#define BITS_PER_CHAR 8 diff --git a/sysdeps/mips/mips64/lshift.S b/sysdeps/mips/mips64/lshift.S deleted file mode 100644 index 20f9e3da19..0000000000 --- a/sysdeps/mips/mips64/lshift.S +++ /dev/null @@ -1,105 +0,0 @@ -/* MIPS3 __mpn_lshift -- - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * src_ptr $5 - * size $6 - * cnt $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_lshift - .ent __mpn_lshift -__mpn_lshift: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - dsll $2,$6,3 - daddu $5,$5,$2 # make r5 point at end of src - ld $10,-8($5) # load first limb - dsubu $13,$0,$7 - daddu $4,$4,$2 # make r4 point at end of res - daddiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - dsrl $2,$10,$13 # compute function result - - dsubu $6,$6,$9 - -L(Loop0): ld $3,-16($5) - daddiu $4,$4,-8 - daddiu $5,$5,-8 - daddiu $9,$9,-1 - dsll $11,$10,$7 - dsrl $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sd $8,0($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): ld $3,-16($5) - daddiu $4,$4,-32 - daddiu $6,$6,-4 - dsll $11,$10,$7 - dsrl $12,$3,$13 - - ld $10,-24($5) - dsll $14,$3,$7 - or $8,$11,$12 - sd $8,24($4) - dsrl $9,$10,$13 - - ld $3,-32($5) - dsll $11,$10,$7 - or $8,$14,$9 - sd $8,16($4) - dsrl $12,$3,$13 - - ld $10,-40($5) - dsll $14,$3,$7 - or $8,$11,$12 - sd $8,8($4) - dsrl $9,$10,$13 - - daddiu $5,$5,-32 - or $8,$14,$9 - bgtz $6,L(Loop) - sd $8,0($4) - -L(Lend): dsll $8,$10,$7 - j $31 - sd $8,-8($4) - .end __mpn_lshift diff --git a/sysdeps/mips/mips64/memcpy.S b/sysdeps/mips/mips64/memcpy.S deleted file mode 100644 index eab9463f86..0000000000 --- a/sysdeps/mips/mips64/memcpy.S +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - Ported to mips3 n32/n64 by Alexandre Oliva <aoliva@redhat.com> - - 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 <sysdep.h> -#include <endian.h> -#include <sys/asm.h> - - -/* void *memcpy(void *s1, const void *s2, size_t n); - - This could probably be optimized further. */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define LDHI ldl /* high part is left in big-endian */ -# define SDHI sdl /* high part is left in big-endian */ -# define LDLO ldr /* low part is right in big-endian */ -# define SDLO sdr /* low part is right in big-endian */ -#else -# define LDHI ldr /* high part is right in little-endian */ -# define SDHI sdr /* high part is right in little-endian */ -# define LDLO ldl /* low part is left in little-endian */ -# define SDLO sdl /* low part is left in little-endian */ -#endif - -ENTRY (memcpy) - .set noreorder - - slti t0, a2, 16 # Less than 16? - bne t0, zero, L(last16) - move v0, a0 # Setup exit value before too late - - xor t0, a1, a0 # Find a0/a1 displacement - andi t0, 0x7 - bne t0, zero, L(shift) # Go handle the unaligned case - PTR_SUBU t1, zero, a1 - andi t1, 0x7 # a0/a1 are aligned, but are we - beq t1, zero, L(chk8w) # starting in the middle of a word? - PTR_SUBU a2, t1 - LDHI t0, 0(a1) # Yes we are... take care of that - PTR_ADDU a1, t1 - SDHI t0, 0(a0) - PTR_ADDU a0, t1 - -L(chk8w): - andi t0, a2, 0x3f # 64 or more bytes left? - beq t0, a2, L(chk1w) - PTR_SUBU a3, a2, t0 # Yes - PTR_ADDU a3, a1 # a3 = end address of loop - move a2, t0 # a2 = what will be left after loop -L(lop8w): - ld t0, 0(a1) # Loop taking 8 words at a time - ld t1, 8(a1) - ld t2, 16(a1) - ld t3, 24(a1) - ld ta0, 32(a1) - ld ta1, 40(a1) - ld ta2, 48(a1) - ld ta3, 56(a1) - PTR_ADDIU a0, 64 - PTR_ADDIU a1, 64 - sd t0, -64(a0) - sd t1, -56(a0) - sd t2, -48(a0) - sd t3, -40(a0) - sd ta0, -32(a0) - sd ta1, -24(a0) - sd ta2, -16(a0) - bne a1, a3, L(lop8w) - sd ta3, -8(a0) - -L(chk1w): - andi t0, a2, 0x7 # 8 or more bytes left? - beq t0, a2, L(last16) - PTR_SUBU a3, a2, t0 # Yes, handle them one dword at a time - PTR_ADDU a3, a1 # a3 again end address - move a2, t0 -L(lop1w): - ld t0, 0(a1) - PTR_ADDIU a0, 8 - PTR_ADDIU a1, 8 - bne a1, a3, L(lop1w) - sd t0, -8(a0) - -L(last16): - blez a2, L(lst16e) # Handle last 16 bytes, one at a time - PTR_ADDU a3, a2, a1 -L(lst16l): - lb t0, 0(a1) - PTR_ADDIU a0, 1 - PTR_ADDIU a1, 1 - bne a1, a3, L(lst16l) - sb t0, -1(a0) -L(lst16e): - jr ra # Bye, bye - nop - -L(shift): - PTR_SUBU a3, zero, a0 # Src and Dest unaligned - andi a3, 0x7 # (unoptimized case...) - beq a3, zero, L(shft1) - PTR_SUBU a2, a3 # a2 = bytes left - LDHI t0, 0(a1) # Take care of first odd part - LDLO t0, 7(a1) - PTR_ADDU a1, a3 - SDHI t0, 0(a0) - PTR_ADDU a0, a3 -L(shft1): - andi t0, a2, 0x7 - PTR_SUBU a3, a2, t0 - PTR_ADDU a3, a1 -L(shfth): - LDHI t1, 0(a1) # Limp through, dword by dword - LDLO t1, 7(a1) - PTR_ADDIU a0, 8 - PTR_ADDIU a1, 8 - bne a1, a3, L(shfth) - sd t1, -8(a0) - b L(last16) # Handle anything which may be left - move a2, t0 - - .set reorder -END (memcpy) -libc_hidden_builtin_def (memcpy) diff --git a/sysdeps/mips/mips64/memset.S b/sysdeps/mips/mips64/memset.S deleted file mode 100644 index b50aaba816..0000000000 --- a/sysdeps/mips/mips64/memset.S +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - Ported to mips3 n32/n64 by Alexandre Oliva <aoliva@redhat.com> - - 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 <sysdep.h> -#include <endian.h> -#include <sys/asm.h> - - -/* void *memset(void *s, int c, size_t n); - - This could probably be optimized further. */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define SDHI sdl /* high part is left in big-endian */ -#else -# define SDHI sdr /* high part is right in little-endian */ -#endif - -ENTRY (memset) - .set noreorder - - slti ta1, a2, 16 # Less than 16? - bne ta1, zero, L(last16) - move v0, a0 # Setup exit value before too late - - beq a1, zero, L(ueven) # If zero pattern, no need to extend - andi a1, 0xff # Avoid problems with bogus arguments - dsll ta0, a1, 8 - or a1, ta0 - dsll ta0, a1, 16 - or a1, ta0 # a1 is now pattern in full word - dsll ta0, a1, 32 - or a1, ta0 # a1 is now pattern in double word - -L(ueven): - PTR_SUBU ta0, zero, a0 # Unaligned address? - andi ta0, 0x7 - beq ta0, zero, L(chkw) - PTR_SUBU a2, ta0 - SDHI a1, 0(a0) # Yes, handle first unaligned part - PTR_ADDU a0, ta0 # Now both a0 and a2 are updated - -L(chkw): - andi ta0, a2, 0xf # Enough left for one loop iteration? - beq ta0, a2, L(chkl) - PTR_SUBU a3, a2, ta0 - PTR_ADDU a3, a0 # a3 is last loop address +1 - move a2, ta0 # a2 is now # of bytes left after loop -L(loopw): - PTR_ADDIU a0, 16 # Handle 2 dwords pr. iteration - sd a1, -16(a0) - bne a0, a3, L(loopw) - sd a1, -8(a0) - -L(chkl): - andi ta0, a2, 0x8 # Check if there is at least a double - beq ta0, zero, L(last16) # word remaining after the loop - PTR_SUBU a2, ta0 - sd a1, 0(a0) # Yes... - PTR_ADDIU a0, 8 - -L(last16): - blez a2, L(exit) # Handle last 16 bytes (if cnt>0) - PTR_ADDU a3, a2, a0 # a3 is last address +1 -L(lst16l): - PTR_ADDIU a0, 1 - bne a0, a3, L(lst16l) - sb a1, -1(a0) -L(exit): - j ra # Bye, bye - nop - - .set reorder -END (memset) -libc_hidden_builtin_def (memset) diff --git a/sysdeps/mips/mips64/mul_1.S b/sysdeps/mips/mips64/mul_1.S deleted file mode 100644 index c711783001..0000000000 --- a/sysdeps/mips/mips64/mul_1.S +++ /dev/null @@ -1,96 +0,0 @@ -/* MIPS3 __mpn_mul_1 -- Multiply a limb vector with a single limb and - * store the product in a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2000, 2002, 2003 - * Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 4 - .globl __mpn_mul_1 - .ent __mpn_mul_1 -__mpn_mul_1: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): mflo $10 - mfhi $9 - daddiu $5,$5,8 - daddu $10,$10,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$10,$2 # carry from previous addition -> $2 - sd $10,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): mflo $10 - mfhi $9 - daddu $10,$10,$2 - sltu $2,$10,$2 - dmultu $8,$7 - sd $10,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): mflo $10 - mfhi $9 - daddu $10,$10,$2 - sltu $2,$10,$2 - sd $10,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_mul_1 diff --git a/sysdeps/mips/mips64/n32/Implies b/sysdeps/mips/mips64/n32/Implies deleted file mode 100644 index a7cb280ec4..0000000000 --- a/sysdeps/mips/mips64/n32/Implies +++ /dev/null @@ -1,4 +0,0 @@ -ieee754/ldbl-128 -mips/mips64 -mips -wordsize-32 diff --git a/sysdeps/mips/mips64/n32/Makefile b/sysdeps/mips/mips64/n32/Makefile deleted file mode 100644 index a84d2a51bd..0000000000 --- a/sysdeps/mips/mips64/n32/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# `long double' is a distinct type we support. -long-double-fcts = yes - -ifeq ($(filter -mabi=n32,$(CC)),) -CC += -mabi=n32 -endif diff --git a/sysdeps/mips/mips64/n64/Implies b/sysdeps/mips/mips64/n64/Implies deleted file mode 100644 index e507786789..0000000000 --- a/sysdeps/mips/mips64/n64/Implies +++ /dev/null @@ -1,4 +0,0 @@ -ieee754/ldbl-128 -mips/mips64 -mips -wordsize-64 diff --git a/sysdeps/mips/mips64/n64/Makefile b/sysdeps/mips/mips64/n64/Makefile deleted file mode 100644 index a823f32b53..0000000000 --- a/sysdeps/mips/mips64/n64/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# `long double' is a distinct type we support. -long-double-fcts = yes - -ifeq ($(filter -mabi=64,$(CC)),) -CC += -mabi=64 -endif diff --git a/sysdeps/mips/mips64/rshift.S b/sysdeps/mips/mips64/rshift.S deleted file mode 100644 index e6a8a06d3d..0000000000 --- a/sysdeps/mips/mips64/rshift.S +++ /dev/null @@ -1,102 +0,0 @@ -/* MIPS3 __mpn_rshift -- - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * src_ptr $5 - * size $6 - * cnt $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_rshift - .ent __mpn_rshift -__mpn_rshift: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) # load first limb - dsubu $13,$0,$7 - daddiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - dsll $2,$10,$13 # compute function result - - dsubu $6,$6,$9 - -L(Loop0): ld $3,8($5) - daddiu $4,$4,8 - daddiu $5,$5,8 - daddiu $9,$9,-1 - dsrl $11,$10,$7 - dsll $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sd $8,-8($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): ld $3,8($5) - daddiu $4,$4,32 - daddiu $6,$6,-4 - dsrl $11,$10,$7 - dsll $12,$3,$13 - - ld $10,16($5) - dsrl $14,$3,$7 - or $8,$11,$12 - sd $8,-32($4) - dsll $9,$10,$13 - - ld $3,24($5) - dsrl $11,$10,$7 - or $8,$14,$9 - sd $8,-24($4) - dsll $12,$3,$13 - - ld $10,32($5) - dsrl $14,$3,$7 - or $8,$11,$12 - sd $8,-16($4) - dsll $9,$10,$13 - - daddiu $5,$5,32 - or $8,$14,$9 - bgtz $6,L(Loop) - sd $8,-8($4) - -L(Lend): dsrl $8,$10,$7 - j $31 - sd $8,0($4) - .end __mpn_rshift diff --git a/sysdeps/mips/mips64/setjmp.S b/sysdeps/mips/mips64/setjmp.S deleted file mode 100644 index bdfd9cd51c..0000000000 --- a/sysdeps/mips/mips64/setjmp.S +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004 - 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 <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -/* The function __sigsetjmp_aux saves all the registers, but it can't - reliably access the stack or frame pointers, so we pass them in as - extra arguments. */ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__sigsetjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp)) - move a2, sp - move a3, fp - PTR_LA t9, __sigsetjmp_aux -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 -#if _MIPS_SIM != _ABIO32 - move a4, gp -#endif - jr t9 - .end __sigsetjmp diff --git a/sysdeps/mips/mips64/setjmp_aux.c b/sysdeps/mips/mips64/setjmp_aux.c deleted file mode 100644 index 26b4739c32..0000000000 --- a/sysdeps/mips/mips64/setjmp_aux.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 1996, 1997, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <setjmp.h> -#include <sgidefs.h> - -/* This function is only called via the assembly language routine - __sigsetjmp, which arranges to pass in the stack pointer and the frame - pointer. We do things this way because it's difficult to reliably - access them in C. */ - -int -__sigsetjmp_aux (jmp_buf env, int savemask, long long sp, long long fp, - long long gp) -{ - /* Store the floating point callee-saved registers... */ -#if _MIPS_SIM == _ABI64 - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f25, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f27, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f29, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[6])); - asm volatile ("s.d $f31, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[7])); -#else - asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); -#endif - - /* .. and the PC; */ - asm volatile ("sd $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); - - /* .. and the stack pointer; */ - env[0].__jmpbuf[0].__sp = sp; - - /* .. and the FP; it'll be in s8. */ - env[0].__jmpbuf[0].__fp = fp; - - /* .. and the GP; */ - env[0].__jmpbuf[0].__gp = gp; - - /* .. and the callee-saved registers; */ - asm volatile ("sd $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); - asm volatile ("sd $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); - asm volatile ("sd $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); - asm volatile ("sd $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); - asm volatile ("sd $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); - asm volatile ("sd $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); - asm volatile ("sd $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); - asm volatile ("sd $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); - - /* .. and finally get and reconstruct the floating point csr. */ - asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); - - /* Save the signal mask if requested. */ - return __sigjmp_save (env, savemask); -} diff --git a/sysdeps/mips/mips64/soft-fp/sfp-machine.h b/sysdeps/mips/mips64/soft-fp/sfp-machine.h deleted file mode 100644 index 309a14a5f8..0000000000 --- a/sysdeps/mips/mips64/soft-fp/sfp-machine.h +++ /dev/null @@ -1,47 +0,0 @@ -#define _FP_W_TYPE_SIZE 64 -#define _FP_W_TYPE unsigned long long -#define _FP_WS_TYPE signed long long -#define _FP_I_TYPE long long - -#define _FP_MUL_MEAT_S(R,X,Y) \ - _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y) -#define _FP_MUL_MEAT_D(R,X,Y) \ - _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_Q(R,X,Y) \ - _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) - -#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) -#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) -#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y) - -#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) -#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1) -#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1 -#define _FP_NANSIGN_S 0 -#define _FP_NANSIGN_D 0 -#define _FP_NANSIGN_Q 0 - -#define _FP_KEEPNANFRACP 1 -/* From my experiments it seems X is chosen unless one of the - NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ - do { \ - if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ - _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ - { \ - R##_s = _FP_NANSIGN_##fs; \ - _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \ - } \ - else \ - { \ - R##_s = X##_s; \ - _FP_FRAC_COPY_##wc(R,X); \ - } \ - R##_c = FP_CLS_NAN; \ - } while (0) - -#define FP_EX_INVALID (1 << 4) -#define FP_EX_DIVZERO (1 << 3) -#define FP_EX_OVERFLOW (1 << 2) -#define FP_EX_UNDERFLOW (1 << 1) -#define FP_EX_INEXACT (1 << 0) diff --git a/sysdeps/mips/mips64/sub_n.S b/sysdeps/mips/mips64/sub_n.S deleted file mode 100644 index aa8b0dcf9a..0000000000 --- a/sysdeps/mips/mips64/sub_n.S +++ /dev/null @@ -1,130 +0,0 @@ -/* MIPS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and - * store difference in a third limb vector. - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * s2_ptr $6 - * size $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_sub_n - .ent __mpn_sub_n -__mpn_sub_n: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) - ld $11,0($6) - - daddiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - move $2,$0 - - dsubu $7,$7,$9 - -L(Loop0): daddiu $9,$9,-1 - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - or $2,$2,$8 - - daddiu $5,$5,8 - daddiu $6,$6,8 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - daddiu $4,$4,8 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): daddiu $7,$7,-4 - - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - or $2,$2,$8 - - ld $10,16($5) - daddu $13,$13,$2 - ld $11,16($6) - sltu $8,$13,$2 - dsubu $13,$12,$13 - sltu $2,$12,$13 - sd $13,8($4) - or $2,$2,$8 - - ld $12,24($5) - daddu $11,$11,$2 - ld $13,24($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,16($4) - or $2,$2,$8 - - ld $10,32($5) - daddu $13,$13,$2 - ld $11,32($6) - sltu $8,$13,$2 - dsubu $13,$12,$13 - sltu $2,$12,$13 - sd $13,24($4) - or $2,$2,$8 - - daddiu $5,$5,32 - daddiu $6,$6,32 - - bne $7,$0,L(Loop) - daddiu $4,$4,32 - -L(Lend): daddu $11,$11,$2 - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_sub_n diff --git a/sysdeps/mips/mips64/submul_1.S b/sysdeps/mips/mips64/submul_1.S deleted file mode 100644 index 4971b992a1..0000000000 --- a/sysdeps/mips/mips64/submul_1.S +++ /dev/null @@ -1,108 +0,0 @@ -/* MIPS3 __mpn_submul_1 -- Multiply a limb vector with a single limb and - * subtract the product from a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2000, 2002, 2003 - * Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 4 - .globl __mpn_submul_1 - .ent __mpn_submul_1 -__mpn_submul_1: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): ld $10,0($4) - mflo $3 - mfhi $9 - daddiu $5,$5,8 - daddu $3,$3,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dmultu $8,$7 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_submul_1 diff --git a/sysdeps/mips/mul_1.S b/sysdeps/mips/mul_1.S deleted file mode 100644 index 72f538670c..0000000000 --- a/sysdeps/mips/mul_1.S +++ /dev/null @@ -1,87 +0,0 @@ -/* MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and -store the product in a second limb vector. - -Copyright (C) 1995, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_mul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): mflo $10 - mfhi $9 - addiu $5,$5,4 - addu $10,$10,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$10,$2 /* carry from previous addition -> $2 */ - sw $10,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - multu $8,$7 - sw $10,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - sw $10,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_mul_1) diff --git a/sysdeps/mips/regdef.h b/sysdeps/mips/regdef.h deleted file mode 100644 index bc7f13b4b5..0000000000 --- a/sysdeps/mips/regdef.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - 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 _REGDEF_H -#define _REGDEF_H - -#include <sys/regdef.h> -#include <sys/fpregdef.h> - -#endif /* _REGDEF_H */ - diff --git a/sysdeps/mips/rshift.S b/sysdeps/mips/rshift.S deleted file mode 100644 index cb688fe2ac..0000000000 --- a/sysdeps/mips/rshift.S +++ /dev/null @@ -1,95 +0,0 @@ -/* MIPS2 __mpn_rshift -- - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - src_ptr $5 - size $6 - cnt $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_rshift) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) /* load first limb */ - subu $13,$0,$7 - addiu $6,$6,-1 - and $9,$6,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop*/ - sll $2,$10,$13 /* compute function result */ - - subu $6,$6,$9 - -L(Loop0): lw $3,4($5) - addiu $4,$4,4 - addiu $5,$5,4 - addiu $9,$9,-1 - srl $11,$10,$7 - sll $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sw $8,-4($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): lw $3,4($5) - addiu $4,$4,16 - addiu $6,$6,-4 - srl $11,$10,$7 - sll $12,$3,$13 - - lw $10,8($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-16($4) - sll $9,$10,$13 - - lw $3,12($5) - srl $11,$10,$7 - or $8,$14,$9 - sw $8,-12($4) - sll $12,$3,$13 - - lw $10,16($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-8($4) - sll $9,$10,$13 - - addiu $5,$5,16 - or $8,$14,$9 - bgtz $6,L(Loop) - sw $8,-4($4) - -L(Lend): srl $8,$10,$7 - j $31 - sw $8,0($4) - END (__mpn_rshift) diff --git a/sysdeps/mips/setjmp.S b/sysdeps/mips/setjmp.S deleted file mode 100644 index 01ef313995..0000000000 --- a/sysdeps/mips/setjmp.S +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 1996, 1997, 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. */ - -#include <sysdep.h> - -/* The function __sigsetjmp_aux saves all the registers, but it can't - reliably access the stack or frame pointers, so we pass them in as - extra arguments. */ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__sigsetjmp) -#ifdef __PIC__ - .set noreorder - .cpload t9 - .set reorder -#endif - move a2, sp -#ifdef fp - move a3, fp -#else - move a3, $fp -#endif -#ifdef __PIC__ - la t9, __sigsetjmp_aux - jr t9 -#else - j __sigsetjmp_aux -#endif - .end __sigsetjmp diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c deleted file mode 100644 index 7125cc4f81..0000000000 --- a/sysdeps/mips/setjmp_aux.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <setjmp.h> - -/* This function is only called via the assembly language routine - __sigsetjmp, which arranges to pass in the stack pointer and the frame - pointer. We do things this way because it's difficult to reliably - access them in C. */ - -int -__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) -{ - /* Store the floating point callee-saved registers... */ - asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); - - /* .. and the PC; */ - asm volatile ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); - - /* .. and the stack pointer; */ - env[0].__jmpbuf[0].__sp = (void *) sp; - - /* .. and the FP; it'll be in s8. */ - env[0].__jmpbuf[0].__fp = (void *) fp; - - /* .. and the GP; */ - asm volatile ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); - - /* .. and the callee-saved registers; */ - asm volatile ("sw $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); - asm volatile ("sw $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); - asm volatile ("sw $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); - asm volatile ("sw $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); - asm volatile ("sw $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); - asm volatile ("sw $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); - asm volatile ("sw $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); - asm volatile ("sw $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); - - /* .. and finally get and reconstruct the floating point csr. */ - asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); - - /* Save the signal mask if requested. */ - return __sigjmp_save (env, savemask); -} diff --git a/sysdeps/mips/sgidefs.h b/sysdeps/mips/sgidefs.h deleted file mode 100644 index 74509fdbd0..0000000000 --- a/sysdeps/mips/sgidefs.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - 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 _SGIDEFS_H -#define _SGIDEFS_H 1 - -/* - * A crude hack to stop <asm/sgidefs.h> - */ -#undef __ASM_SGIDEFS_H -#define __ASM_SGIDEFS_H - -/* - * And remove any damage it might have already done - */ -#undef _MIPS_ISA_MIPS1 -#undef _MIPS_ISA_MIPS2 -#undef _MIPS_ISA_MIPS3 -#undef _MIPS_ISA_MIPS4 -#undef _MIPS_ISA_MIPS5 -#undef _MIPS_ISA_MIPS32 -#undef _MIPS_ISA_MIPS64 - -#undef _MIPS_SIM_ABI32 -#undef _MIPS_SIM_NABI32 -#undef _MIPS_SIM_ABI64 - -/* - * Definitions for the ISA level - */ -#define _MIPS_ISA_MIPS1 1 -#define _MIPS_ISA_MIPS2 2 -#define _MIPS_ISA_MIPS3 3 -#define _MIPS_ISA_MIPS4 4 -#define _MIPS_ISA_MIPS5 5 -#define _MIPS_ISA_MIPS32 6 -#define _MIPS_ISA_MIPS64 7 - -/* - * Subprogram calling convention - */ -#ifndef _ABIO32 -# define _ABIO32 1 -#endif -#define _MIPS_SIM_ABI32 _ABIO32 - -#ifndef _ABIN32 -# define _ABIN32 2 -#endif -#define _MIPS_SIM_NABI32 _ABIN32 - -#ifndef _ABI64 -# define _ABI64 3 -#endif -#define _MIPS_SIM_ABI64 _ABI64 - -#endif /* sgidefs.h */ diff --git a/sysdeps/mips/soft-fp/sfp-machine.h b/sysdeps/mips/soft-fp/sfp-machine.h deleted file mode 100644 index 3b2a40f0e2..0000000000 --- a/sysdeps/mips/soft-fp/sfp-machine.h +++ /dev/null @@ -1,47 +0,0 @@ -#define _FP_W_TYPE_SIZE 32 -#define _FP_W_TYPE unsigned long -#define _FP_WS_TYPE signed long -#define _FP_I_TYPE long - -#define _FP_MUL_MEAT_S(R,X,Y) \ - _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_D(R,X,Y) \ - _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_Q(R,X,Y) \ - _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) - -#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y) -#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) -#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) - -#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) -#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 -#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 -#define _FP_NANSIGN_S 0 -#define _FP_NANSIGN_D 0 -#define _FP_NANSIGN_Q 0 - -#define _FP_KEEPNANFRACP 1 -/* From my experiments it seems X is chosen unless one of the - NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ - do { \ - if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ - _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ - { \ - R##_s = _FP_NANSIGN_##fs; \ - _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \ - } \ - else \ - { \ - R##_s = X##_s; \ - _FP_FRAC_COPY_##wc(R,X); \ - } \ - R##_c = FP_CLS_NAN; \ - } while (0) - -#define FP_EX_INVALID (1 << 4) -#define FP_EX_DIVZERO (1 << 3) -#define FP_EX_OVERFLOW (1 << 2) -#define FP_EX_UNDERFLOW (1 << 1) -#define FP_EX_INEXACT (1 << 0) diff --git a/sysdeps/mips/stackinfo.h b/sysdeps/mips/stackinfo.h deleted file mode 100644 index 86e3d621ba..0000000000 --- a/sysdeps/mips/stackinfo.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 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. */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -/* On MIPS the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -#endif /* stackinfo.h */ diff --git a/sysdeps/mips/sub_n.S b/sysdeps/mips/sub_n.S deleted file mode 100644 index 53fa019343..0000000000 --- a/sysdeps/mips/sub_n.S +++ /dev/null @@ -1,122 +0,0 @@ -/* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and -store difference in a third limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - s2_ptr $6 - size $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_sub_n) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - move $2,$0 - - subu $7,$7,$9 - -L(Loop0): addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - addiu $4,$4,4 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,L(Loop) - addiu $4,$4,16 - -L(Lend): addu $11,$11,$2 - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - j $31 - or $2,$2,$8 - END (__mpn_sub_n) diff --git a/sysdeps/mips/submul_1.S b/sysdeps/mips/submul_1.S deleted file mode 100644 index 4c8a612650..0000000000 --- a/sysdeps/mips/submul_1.S +++ /dev/null @@ -1,99 +0,0 @@ -/* MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and -subtract the product from a second limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_submul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$3,$2 /* carry from previous addition -> $2 */ - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_submul_1) diff --git a/sysdeps/mips/sys/asm.h b/sysdeps/mips/sys/asm.h deleted file mode 100644 index b590802fd9..0000000000 --- a/sysdeps/mips/sys/asm.h +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (C) 1997, 1998, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - 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 _SYS_ASM_H -#define _SYS_ASM_H - -#include <sgidefs.h> - -#ifndef CAT -# ifdef __STDC__ -# define __CAT(str1,str2) str1##str2 -# else -# define __CAT(str1,str2) str1/**/str2 -# endif -# define CAT(str1,str2) __CAT(str1,str2) -#endif - -/* - * Macros to handle different pointer/register sizes for 32/64-bit code - * - * 64 bit address space isn't used yet, so we may use the R3000 32 bit - * defines for now. - */ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 -# define PTR .word -# define PTRSIZE 4 -# define PTRLOG 2 -#elif _MIPS_SIM == _ABI64 -# define PTR .dword -# define PTRSIZE 8 -# define PTRLOG 3 -#endif - -/* - * PIC specific declarations - */ -#if _MIPS_SIM == _ABIO32 -# ifdef __PIC__ -# define CPRESTORE(register) \ - .cprestore register -# define CPLOAD(register) \ - .cpload register -# else -# define CPRESTORE(register) -# define CPLOAD(register) -# endif - -# define CPADD(register) \ - .cpadd register - -/* - * Set gp when at 1st instruction - */ -# define SETUP_GP \ - .set noreorder; \ - .cpload $25; \ - .set reorder -/* Set gp when not at 1st instruction */ -# define SETUP_GPX(r) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal 10f; /* Find addr of cpload. */ \ - nop; \ -10: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SETUP_GPX_L(r, l) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal l; /* Find addr of cpload. */ \ - nop; \ -l: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SAVE_GP(x) \ - .cprestore x /* Save gp trigger t9/jalr conversion. */ -# define SETUP_GP64(a, b) -# define SETUP_GPX64(a, b) -# define SETUP_GPX64_L(cp_reg, ra_save, l) -# define RESTORE_GP64 -# define USE_ALT_CP(a) -#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */ -/* - * For callee-saved gp calling convention: - */ -# define SETUP_GP -# define SETUP_GPX(r) -# define SETUP_GPX_L(r, l) -# define SAVE_GP(x) - -# define SETUP_GP64(gpoffset, proc) \ - .cpsetup $25, gpoffset, proc -# define SETUP_GPX64(cp_reg, ra_save) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal 10f; /* Find addr of .cpsetup. */ \ - nop; \ -10: \ - .set reorder; \ - .cpsetup $31, cp_reg, 10b; \ - move $31, ra_save -# define SETUP_GPX64_L(cp_reg, ra_save, l) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal l; /* Find addr of .cpsetup. */ \ - nop; \ -l: \ - .set reorder; \ - .cpsetup $31, cp_reg, l; \ - move $31, ra_save -# define RESTORE_GP64 \ - .cpreturn -/* Use alternate register for context pointer. */ -# define USE_ALT_CP(reg) \ - .cplocal reg -#endif /* _MIPS_SIM != _ABIO32 */ - -/* - * Stack Frame Definitions - */ -#if _MIPS_SIM == _ABIO32 -# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */ -#endif -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define NARGSAVE 0 /* No caller responsibilities. */ -#endif - - -/* - * LEAF - declare leaf routine - */ -#define LEAF(symbol) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp,0,ra - -/* - * NESTED - declare nested routine entry point - */ -#define NESTED(symbol, framesize, rpc) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp, framesize, rpc - -/* - * END - mark end of function - */ -#ifndef END -# define END(function) \ - .end function; \ - .size function,.-function -#endif - -/* - * EXPORT - export definition of symbol - */ -#define EXPORT(symbol) \ - .globl symbol; \ -symbol: - -/* - * ABS - export absolute symbol - */ -#define ABS(symbol,value) \ - .globl symbol; \ -symbol = value - -#define PANIC(msg) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal panic; \ -9: b 9b; \ - .set pop; \ - TEXT(msg) - -/* - * Print formated string - */ -#define PRINT(string) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal printk; \ - .set pop; \ - TEXT(string) - -#define TEXT(msg) \ - .data; \ -8: .asciiz msg; \ - .previous; - -/* - * Build text tables - */ -#define TTABLE(string) \ - .text; \ - .word 1f; \ - .previous; \ - .data; \ -1: .asciz string; \ - .previous - -/* - * MIPS IV pref instruction. - * Use with .set noreorder only! - * - * MIPS IV implementations are free to treat this as a nop. The R5000 - * is one of them. So we should have an option not to use this instruction. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define PREF(hint,addr) \ - pref hint,addr -# define PREFX(hint,addr) \ - prefx hint,addr -#else -# define PREF -# define PREFX -#endif - -/* - * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. - */ -#if _MIPS_ISA == _MIPS_ISA_MIPS1 -# define MOVN(rd,rs,rt) \ - .set push; \ - .set reorder; \ - beqz rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set reorder; \ - bnez rt,9f; \ - move rd,rt; \ - .set pop; \ -9: -#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) -# define MOVN(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - bnezl rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - beqzl rt,9f; \ - movz rd,rs; \ - .set pop; \ -9: -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MOVN(rd,rs,rt) \ - movn rd,rs,rt -# define MOVZ(rd,rs,rt) \ - movz rd,rs,rt -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */ - -/* - * Stack alignment - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define ALSZ 15 -# define ALMASK ~15 -#else -# define ALSZ 7 -# define ALMASK ~7 -#endif - -/* - * Size of a register - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define SZREG 8 -#else -# define SZREG 4 -#endif - -/* - * Use the following macros in assemblercode to load/store registers, - * pointers etc. - */ -#if (SZREG == 4) -# define REG_S sw -# define REG_L lw -#else -# define REG_S sd -# define REG_L ld -#endif - -/* - * How to add/sub/load/store/shift C int variables. - */ -#if (_MIPS_SZINT == 32) -# define INT_ADD add -# define INT_ADDI addi -# define INT_ADDU addu -# define INT_ADDIU addiu -# define INT_SUB add -# define INT_SUBI subi -# define INT_SUBU subu -# define INT_SUBIU subu -# define INT_L lw -# define INT_S sw -#endif - -#if (_MIPS_SZINT == 64) -# define INT_ADD dadd -# define INT_ADDI daddi -# define INT_ADDU daddu -# define INT_ADDIU daddiu -# define INT_SUB dadd -# define INT_SUBI dsubi -# define INT_SUBU dsubu -# define INT_SUBIU dsubu -# define INT_L ld -# define INT_S sd -#endif - -/* - * How to add/sub/load/store/shift C long variables. - */ -#if (_MIPS_SZLONG == 32) -# define LONG_ADD add -# define LONG_ADDI addi -# define LONG_ADDU addu -# define LONG_ADDIU addiu -# define LONG_SUB add -# define LONG_SUBI subi -# define LONG_SUBU subu -# define LONG_SUBIU subu -# define LONG_L lw -# define LONG_S sw -# define LONG_SLL sll -# define LONG_SLLV sllv -# define LONG_SRL srl -# define LONG_SRLV srlv -# define LONG_SRA sra -# define LONG_SRAV srav -#endif - -#if (_MIPS_SZLONG == 64) -# define LONG_ADD dadd -# define LONG_ADDI daddi -# define LONG_ADDU daddu -# define LONG_ADDIU daddiu -# define LONG_SUB dadd -# define LONG_SUBI dsubi -# define LONG_SUBU dsubu -# define LONG_SUBIU dsubu -# define LONG_L ld -# define LONG_S sd -# define LONG_SLL dsll -# define LONG_SLLV dsllv -# define LONG_SRL dsrl -# define LONG_SRLV dsrlv -# define LONG_SRA dsra -# define LONG_SRAV dsrav -#endif - -/* - * How to add/sub/load/store/shift pointers. - */ -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32) -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUB add -# define PTR_SUBI subi -# define PTR_SUBU subu -# define PTR_SUBIU subu -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU add /* no u */ -# define PTR_ADDIU addi /* no u */ -# define PTR_SUB add -# define PTR_SUBI subi -# define PTR_SUBU sub /* no u */ -# define PTR_SUBIU sub /* no u */ -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \ - || _MIPS_SIM == _ABI64 -# define PTR_ADD dadd -# define PTR_ADDI daddi -# define PTR_ADDU daddu -# define PTR_ADDIU daddiu -# define PTR_SUB dadd -# define PTR_SUBI dsubi -# define PTR_SUBU dsubu -# define PTR_SUBIU dsubu -# define PTR_L ld -# define PTR_LA dla -# define PTR_S sd -# define PTR_SLL dsll -# define PTR_SLLV dsllv -# define PTR_SRL dsrl -# define PTR_SRLV dsrlv -# define PTR_SRA dsra -# define PTR_SRAV dsrav - -# define PTR_SCALESHIFT 3 -#endif - -/* - * Some cp0 registers were extended to 64bit for MIPS III. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) -# define MFC0 mfc0 -# define MTC0 mtc0 -#endif -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MFC0 dmfc0 -# define MTC0 dmtc0 -#endif - -/* The MIPS archtectures do not have a uniform memory model. Particular - platforms may provide additional guarantees - for instance, the R4000 - LL and SC instructions implicitly perform a SYNC, and the 4K promises - strong ordering. - - However, in the absence of those guarantees, we must assume weak ordering - and SYNC explicitly where necessary. - - Some obsolete MIPS processors may not support the SYNC instruction. This - applies to "true" MIPS I processors; most of the processors which compile - using MIPS I implement parts of MIPS II. */ - -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#endif /* sys/asm.h */ diff --git a/sysdeps/mips/sys/fpregdef.h b/sysdeps/mips/sys/fpregdef.h deleted file mode 100644 index 378115274f..0000000000 --- a/sysdeps/mips/sys/fpregdef.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 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 _SYS_FPREGDEF_H -#define _SYS_FPREGDEF_H - -/* - * These definitions only cover the R3000-ish 16/32 register model. - * But we're trying to be R3000 friendly anyway ... - */ -#define fv0 $f0 /* return value */ -#define fv0f $f1 -#define fv1 $f2 -#define fv1f $f3 -#define fa0 $f12 /* argument registers */ -#define fa0f $f13 -#define fa1 $f14 -#define fa1f $f15 -#define ft0 $f4 /* caller saved */ -#define ft0f $f5 -#define ft1 $f6 -#define ft1f $f7 -#define ft2 $f8 -#define ft2f $f9 -#define ft3 $f10 -#define ft3f $f11 -#define ft4 $f16 -#define ft4f $f17 -#define ft5 $f18 -#define ft5f $f19 -#define fs0 $f20 /* callee saved */ -#define fs0f $f21 -#define fs1 $f22 -#define fs1f $f23 -#define fs2 $f24 -#define fs2f $f25 -#define fs3 $f26 -#define fs3f $f27 -#define fs4 $f28 -#define fs4f $f29 -#define fs5 $f30 -#define fs5f $f31 - -#define fcr31 $31 /* FPU status register */ - -#endif /* sys/fpregdef.h */ diff --git a/sysdeps/mips/sys/regdef.h b/sysdeps/mips/sys/regdef.h deleted file mode 100644 index 8fb898a2d0..0000000000 --- a/sysdeps/mips/sys/regdef.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (C) 1997, 1998, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - 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 _SYS_REGDEF_H -#define _SYS_REGDEF_H - -#include <sgidefs.h> - -/* - * Symbolic register names for 32 bit ABI - */ -#define zero $0 /* wired zero */ -#define AT $1 /* assembler temp - uppercase because of ".set at" */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#if _MIPS_SIM != _ABIO32 -#define a4 $8 -#define a5 $9 -#define a6 $10 -#define a7 $11 -#define t0 $12 -#define t1 $13 -#define t2 $14 -#define t3 $15 -#define ta0 a4 -#define ta1 a5 -#define ta2 a6 -#define ta3 a7 -#else /* if _MIPS_SIM == _ABIO32 */ -#define t0 $8 /* caller saved */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define ta0 t4 -#define ta1 t5 -#define ta2 t6 -#define ta3 t7 -#endif /* _MIPS_SIM == _ABIO32 */ -#define s0 $16 /* callee saved */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* caller saved */ -#define t9 $25 -#define jp $25 /* PIC jump register */ -#define k0 $26 /* kernel scratch */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define fp $30 /* frame pointer */ -#define s8 $30 /* same like fp! */ -#define ra $31 /* return address */ - -#endif /* _SYS_REGDEF_H */ diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h deleted file mode 100644 index fe378e94cd..0000000000 --- a/sysdeps/mips/sys/ucontext.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (C) 1998, 1999, 2002, 2003, 2004 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. */ - -/* System V/mips ABI compliant context switching support. */ - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <sgidefs.h> -#include <signal.h> - -/* Type for general register. */ -#if _MIPS_SIM == _ABIO32 -typedef __uint32_t greg_t; -#else -typedef __uint64_t greg_t; -#endif - -/* Number of general registers. */ -#define NGREG 36 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Number of each register is the `gregset_t' array. */ -enum -{ - CTX_R0 = 0, -#define CTX_R0 CTX_R0 - CTX_AT = 1, -#define CTX_AT CTX_AT - CTX_V0 = 2, -#define CTX_V0 CTX_V0 - CTX_V1 = 3, -#define CTX_V1 CTX_V1 - CTX_A0 = 4, -#define CTX_A0 CTX_A0 - CTX_A1 = 5, -#define CTX_A1 CTX_A1 - CTX_A2 = 6, -#define CTX_A2 CTX_A2 - CTX_A3 = 7, -#define CTX_A3 CTX_A3 - CTX_T0 = 8, -#define CTX_T0 CTX_T0 - CTX_T1 = 9, -#define CTX_T1 CTX_T1 - CTX_T2 = 10, -#define CTX_T2 CTX_T2 - CTX_T3 = 11, -#define CTX_T3 CTX_T3 - CTX_T4 = 12, -#define CTX_T4 CTX_T4 - CTX_T5 = 13, -#define CTX_T5 CTX_T5 - CTX_T6 = 14, -#define CTX_T6 CTX_T6 - CTX_T7 = 15, -#define CTX_T7 CTX_T7 - CTX_S0 = 16, -#define CTX_S0 CTX_S0 - CTX_S1 = 17, -#define CTX_S1 CTX_S1 - CTX_S2 = 18, -#define CTX_S2 CTX_S2 - CTX_S3 = 19, -#define CTX_S3 CTX_S3 - CTX_S4 = 20, -#define CTX_S4 CTX_S4 - CTX_S5 = 21, -#define CTX_S5 CTX_S5 - CTX_S6 = 22, -#define CTX_S6 CTX_S6 - CTX_S7 = 23, -#define CTX_S7 CTX_S7 - CTX_T8 = 24, -#define CTX_T8 CTX_T8 - CTX_T9 = 25, -#define CTX_T9 CTX_T9 - CTX_K0 = 26, -#define CTX_K0 CTX_K0 - CTX_K1 = 27, -#define CTX_K1 CTX_K1 - CTX_GP = 28, -#define CTX_GP CTX_GP - CTX_SP = 29, -#define CTX_SP CTX_SP - CTX_S8 = 30, -#define CTX_S8 CTX_S8 - CTX_RA = 31, -#define CTX_RA CTX_RA - CTX_MDLO = 32, -#define CTX_MDLO CTX_MDLO - CTX_MDHI = 33, -#define CTX_MDHI CTX_MDHI - CTX_CAUSE = 34, -#define CTX_CAUSE CTX_CAUSE - CTX_EPC = 35, -#define CTX_EPC CTX_EPC -}; - -/* Structure to describe FPU registers. */ -typedef struct fpregset -{ - union - { -#if _MIPS_SIM == _ABIO32 - double fp_dregs[16]; - float fp_fregs[32]; - unsigned int fp_regs[32]; -#else - double fp_dregs[32]; - /* float fp_fregs[32]; */ - __uint64_t fp_regs[32]; -#endif - } fp_r; - unsigned int fp_csr; - unsigned int fp_pad; -} fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct -{ - gregset_t gpregs; - fpregset_t fpregs; -} mcontext_t; - -/* Userlevel context. */ -typedef struct ucontext -{ -#if _MIPS_SIM == _ABIO32 - unsigned long int uc_flags; -#else - __uint64_t uc_flags; -#endif - struct ucontext *uc_link; - __sigset_t uc_sigmask; - stack_t uc_stack; - mcontext_t uc_mcontext; - int uc_filler[48]; -} ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/mips/tls-macros.h b/sysdeps/mips/tls-macros.h deleted file mode 100644 index 2d0516b3e4..0000000000 --- a/sysdeps/mips/tls-macros.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Macros to support TLS testing in times of missing compiler support. */ - -#if _MIPS_SIM != _ABI64 - -/* These versions are for o32 and n32. */ - -# define TLS_GD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("addiu %0, $28, %%tlsgd(" #x ")" \ - : "=r" (__result)); \ - (int *)__tls_get_addr (__result); }) -#else -# define TLS_GD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("daddiu %0, $28, %%tlsgd(" #x ")" \ - : "=r" (__result)); \ - (int *)__tls_get_addr (__result); }) -#endif - -#if _MIPS_SIM != _ABI64 -# define TLS_LD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("addiu %0, $28, %%tlsldm(" #x ")" \ - : "=r" (__result)); \ - __result = __tls_get_addr (__result); \ - asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \ - "addiu $3,$3,%%dtprel_lo(" #x ")\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_IE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lw $3,%%gottprel(" #x ")($28)\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_LE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lui $3,%%tprel_hi(" #x ")\n\t" \ - "addiu $3,$3,%%tprel_lo(" #x ")\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) - -#else - -/* These versions are for n64. */ - -# define TLS_LD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("daddiu %0, $28, %%tlsldm(" #x ")" \ - : "=r" (__result)); \ - __result = __tls_get_addr (__result); \ - asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \ - "daddiu $3,$3,%%dtprel_lo(" #x ")\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_IE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("ld $3,%%gottprel(" #x ")($28)\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_LE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lui $3,%%tprel_hi(" #x ")\n\t" \ - "daddiu $3,$3,%%tprel_lo(" #x ")\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -#endif diff --git a/sysdeps/posix/Makefile b/sysdeps/posix/Makefile new file mode 100644 index 0000000000..b58aa6aadb --- /dev/null +++ b/sysdeps/posix/Makefile @@ -0,0 +1,5 @@ +# These affect the generated bits/stdio_lim.h file. +L_tmpnam = 20 +TMP_MAX = 238328 +L_ctermid = 9 +L_cuserid = 9 diff --git a/sysdeps/powerpc/soft-fp/q_add.c b/sysdeps/powerpc/soft-fp/q_add.c index 4338803932..80a0b3f6d3 100644 --- a/sysdeps/powerpc/soft-fp/q_add.c +++ b/sysdeps/powerpc/soft-fp/q_add.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,10 +30,10 @@ long double _q_add(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_ADD_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/powerpc/soft-fp/q_dtoq.c b/sysdeps/powerpc/soft-fp/q_dtoq.c index 6c4c74037e..baebea546b 100644 --- a/sysdeps/powerpc/soft-fp/q_dtoq.c +++ b/sysdeps/powerpc/soft-fp/q_dtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ long double _q_dtoq(const double a) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); + FP_UNPACK_RAW_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,D,4,2,C,A); + FP_EXTEND(Q,D,4,2,C,A); #else - FP_CONV(Q,D,2,1,C,A); + FP_EXTEND(Q,D,2,1,C,A); #endif - FP_PACK_Q(c, C); + FP_PACK_RAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/powerpc/soft-fp/q_itoq.c b/sysdeps/powerpc/soft-fp/q_itoq.c index 166138c24e..e2884005ae 100644 --- a/sysdeps/powerpc/soft-fp/q_itoq.c +++ b/sysdeps/powerpc/soft-fp/q_itoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,8 +30,8 @@ long double _q_itoq(const int a) int b = a; long double c; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/powerpc/soft-fp/q_lltoq.c b/sysdeps/powerpc/soft-fp/q_lltoq.c index 6412eccd3e..22d2e55fac 100644 --- a/sysdeps/powerpc/soft-fp/q_lltoq.c +++ b/sysdeps/powerpc/soft-fp/q_lltoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,8 +30,8 @@ long double _q_lltoq(const long long a) long double c; long long b = a; - FP_FROM_INT_Q(C, b, 64, long long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long long); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/powerpc/soft-fp/q_qtod.c b/sysdeps/powerpc/soft-fp/q_qtod.c index d107f38696..685aa68e6d 100644 --- a/sysdeps/powerpc/soft-fp/q_qtod.c +++ b/sysdeps/powerpc/soft-fp/q_qtod.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (double)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ double _q_qtod(const long double a) double r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(D,Q,2,4,R,A); + FP_TRUNC(D,Q,2,4,R,A); #else - FP_CONV(D,Q,1,2,R,A); + FP_TRUNC(D,Q,1,2,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/powerpc/soft-fp/q_qtoi.c b/sysdeps/powerpc/soft-fp/q_qtoi.c index 90c01e6e7a..89410d1253 100644 --- a/sysdeps/powerpc/soft-fp/q_qtoi.c +++ b/sysdeps/powerpc/soft-fp/q_qtoi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (int)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -28,9 +28,9 @@ int _q_qtoi(const long double a) { FP_DECL_EX; FP_DECL_Q(A); - int r; + unsigned int r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 32, 1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/powerpc/soft-fp/q_qtoll.c b/sysdeps/powerpc/soft-fp/q_qtoll.c index 72bde2e62a..3b0251f1ba 100644 --- a/sysdeps/powerpc/soft-fp/q_qtoll.c +++ b/sysdeps/powerpc/soft-fp/q_qtoll.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -28,9 +28,9 @@ long long _q_qtoll(const long double a) { FP_DECL_EX; FP_DECL_Q(A); - long long r; + unsigned long long r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, 1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/powerpc/soft-fp/q_qtos.c b/sysdeps/powerpc/soft-fp/q_qtos.c index ebd6baee95..0d71271d01 100644 --- a/sysdeps/powerpc/soft-fp/q_qtos.c +++ b/sysdeps/powerpc/soft-fp/q_qtos.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (float)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ float _q_qtos(const long double a) float r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(S,Q,1,4,R,A); + FP_TRUNC(S,Q,1,4,R,A); #else - FP_CONV(S,Q,1,2,R,A); + FP_TRUNC(S,Q,1,2,R,A); #endif - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/powerpc/soft-fp/q_qtou.c b/sysdeps/powerpc/soft-fp/q_qtou.c index b9119d037c..e5d21f1f4d 100644 --- a/sysdeps/powerpc/soft-fp/q_qtou.c +++ b/sysdeps/powerpc/soft-fp/q_qtou.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (unsigned int)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,7 +30,7 @@ unsigned int _q_qtou(const long double a) FP_DECL_Q(A); unsigned int r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 32, -1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/powerpc/soft-fp/q_qtoull.c b/sysdeps/powerpc/soft-fp/q_qtoull.c index 9fcefd60be..a01100c797 100644 --- a/sysdeps/powerpc/soft-fp/q_qtoull.c +++ b/sysdeps/powerpc/soft-fp/q_qtoull.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,7 +30,7 @@ unsigned long long _q_qtoull(const long double a) FP_DECL_Q(A); unsigned long long r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, -1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/powerpc/soft-fp/q_stoq.c b/sysdeps/powerpc/soft-fp/q_stoq.c index 3fc4a5970d..f43a93ceab 100644 --- a/sysdeps/powerpc/soft-fp/q_stoq.c +++ b/sysdeps/powerpc/soft-fp/q_stoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = (long double)(a) - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,13 +31,13 @@ long double _q_stoq(const float a) FP_DECL_Q(C); long double c; - FP_UNPACK_S(A, a); + FP_UNPACK_RAW_S(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,S,4,1,C,A); + FP_EXTEND(Q,S,4,1,C,A); #else - FP_CONV(Q,S,2,1,C,A); + FP_EXTEND(Q,S,2,1,C,A); #endif - FP_PACK_Q(c, C); + FP_PACK_RAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/powerpc/soft-fp/q_sub.c b/sysdeps/powerpc/soft-fp/q_sub.c index 50c56b29c4..399be021d2 100644 --- a/sysdeps/powerpc/soft-fp/q_sub.c +++ b/sysdeps/powerpc/soft-fp/q_sub.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = a - b - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,10 +30,10 @@ long double _q_sub(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_SUB_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/powerpc/soft-fp/q_ulltoq.c b/sysdeps/powerpc/soft-fp/q_ulltoq.c index 428f201e15..30f5fc9bfa 100644 --- a/sysdeps/powerpc/soft-fp/q_ulltoq.c +++ b/sysdeps/powerpc/soft-fp/q_ulltoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)a - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,8 +30,8 @@ long double _q_ulltoq(const unsigned long long a) long double c; unsigned long long b = a; - FP_FROM_INT_Q(C, b, 64, long long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long long); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/powerpc/soft-fp/q_utoq.c b/sysdeps/powerpc/soft-fp/q_utoq.c index 87607e3ab9..232bcfe3e9 100644 --- a/sysdeps/powerpc/soft-fp/q_utoq.c +++ b/sysdeps/powerpc/soft-fp/q_utoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = (long double)(a) - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,8 +30,8 @@ long double _q_uitoq(const unsigned int a) long double c; unsigned int b = a; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c b/sysdeps/sparc/dl-procinfo.c index e9042d9717..875820fab3 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c +++ b/sysdeps/sparc/dl-procinfo.c @@ -1,5 +1,5 @@ -/* Data for Linux/sparc32 version of processor capability information. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Data for Linux/sparc version of processor capability information. + Copyright (C) 2002,2003,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -45,14 +45,12 @@ #endif #if !defined PROCINFO_DECL && defined SHARED - ._dl_sparc32_cap_flags + ._dl_sparc_cap_flags #else -PROCINFO_CLASS const char _dl_sparc32_cap_flags[6][7] +PROCINFO_CLASS const char _dl_sparc_cap_flags[7][7] #endif #ifndef PROCINFO_DECL -= { - "flush", "stbar", "swap", "muldiv", "v9", "ultra3" - } + = { "flush", "stbar", "swap", "muldiv", "v9", "ultra3", "v9v" } #endif #if !defined SHARED || defined PROCINFO_DECL ; diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h index 82a94fca9c..dde02b556c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h +++ b/sysdeps/sparc/dl-procinfo.h @@ -1,5 +1,6 @@ -/* Linux/sparc32 version of processor capability information handling macros. - Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. +/* Linux/sparc version of processor capability information handling macros. + Copyright (C) 1999,2000,2001,2002,2003,2004,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999. @@ -23,7 +24,7 @@ #include <ldsodefs.h> -#define _DL_HWCAP_COUNT 6 +#define _DL_HWCAP_COUNT 7 static inline int __attribute__ ((unused)) @@ -35,7 +36,7 @@ _dl_procinfo (int word) for (i = 0; i < _DL_HWCAP_COUNT; ++i) if (word & (1 << i)) - _dl_printf (" %s", GLRO(dl_sparc32_cap_flags)[i]); + _dl_printf (" %s", GLRO(dl_sparc_cap_flags)[i]); _dl_printf ("\n"); @@ -46,7 +47,7 @@ static inline const char * __attribute__ ((unused)) _dl_hwcap_string (int idx) { - return GLRO(dl_sparc32_cap_flags)[idx]; + return GLRO(dl_sparc_cap_flags)[idx]; }; static inline int @@ -56,13 +57,16 @@ _dl_string_hwcap (const char *str) int i; for (i = 0; i < _DL_HWCAP_COUNT; i++) { - if (strcmp (str, GLRO(dl_sparc32_cap_flags) [i]) == 0) + if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0) return i; } return -1; }; -#define HWCAP_IMPORTANT (HWCAP_SPARC_V9|HWCAP_SPARC_ULTRA3) +#include <bits/wordsize.h> +#define HWCAP_IMPORTANT_V9 (__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9) +#define HWCAP_IMPORTANT (HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \ + | HWCAP_SPARC_BLKINIT) /* There are no different platforms defined. */ #define _dl_platform_string(idx) "" diff --git a/sysdeps/sparc/sparc32/soft-fp/q_add.c b/sysdeps/sparc/sparc32/soft-fp/q_add.c index fb93461593..987c725582 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_add.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_add.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,10 +30,10 @@ long double _Q_add(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_ADD_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c b/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c index 5cac5c0840..6b119f4501 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ long double _Q_dtoq(const double a) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); + FP_UNPACK_RAW_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,D,4,2,C,A); + FP_EXTEND(Q,D,4,2,C,A); #else - FP_CONV(Q,D,2,1,C,A); + FP_EXTEND(Q,D,2,1,C,A); #endif - FP_PACK_Q(c, C); + FP_PACK_RAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c b/sysdeps/sparc/sparc32/soft-fp/q_itoq.c index 0010b3bcbf..b50942f75f 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_itoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,8 +30,8 @@ long double _Q_itoq(const int a) int b = a; long double c; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c b/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c index c801ca86f1..f977585e42 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c @@ -30,8 +30,8 @@ long double _Q_lltoq(const long long a) long double c; long long b = a; - FP_FROM_INT_Q(C, b, 64, long long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long long); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c b/sysdeps/sparc/sparc32/soft-fp/q_qtod.c index b0778476b8..82b01ec8a1 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtod.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (double)a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ double _Q_qtod(const long double a) double r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(D,Q,2,4,R,A); + FP_TRUNC(D,Q,2,4,R,A); #else - FP_CONV(D,Q,1,2,R,A); + FP_TRUNC(D,Q,1,2,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c index 0440e9abba..270ba9f677 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (int)a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -28,9 +28,9 @@ int _Q_qtoi(const long double a) { FP_DECL_EX; FP_DECL_Q(A); - int r; + unsigned int r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 32, 1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c index af328bda1c..e0d29019b3 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c @@ -28,9 +28,9 @@ long long _Q_qtoll(const long double a) { FP_DECL_EX; FP_DECL_Q(A); - long long r; + unsigned long long r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, 1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c b/sysdeps/sparc/sparc32/soft-fp/q_qtos.c index 31c8d6ac82..93daa23cac 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtos.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (float)a - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ float _Q_qtos(const long double a) float r; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); + FP_UNPACK_SEMIRAW_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(S,Q,1,4,R,A); + FP_TRUNC(S,Q,1,4,R,A); #else - FP_CONV(S,Q,1,2,R,A); + FP_TRUNC(S,Q,1,2,R,A); #endif - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c b/sysdeps/sparc/sparc32/soft-fp/q_qtou.c index 041a78e28c..812b4e06ea 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtou.c @@ -30,7 +30,7 @@ unsigned int _Q_qtou(const long double a) FP_DECL_Q(A); unsigned int r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 32, -1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c index 8170e994f5..7a88c9f382 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c @@ -30,7 +30,7 @@ unsigned long long _Q_qtoull(const long double a) FP_DECL_Q(A); unsigned long long r; - FP_UNPACK_Q(A, a); + FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, -1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c b/sysdeps/sparc/sparc32/soft-fp/q_stoq.c index 98609faf20..714d880dd7 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_stoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,13 +31,13 @@ long double _Q_stoq(const float a) FP_DECL_Q(C); long double c; - FP_UNPACK_S(A, a); + FP_UNPACK_RAW_S(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,S,4,1,C,A); + FP_EXTEND(Q,S,4,1,C,A); #else - FP_CONV(Q,S,2,1,C,A); + FP_EXTEND(Q,S,2,1,C,A); #endif - FP_PACK_Q(c, C); + FP_PACK_RAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_sub.c b/sysdeps/sparc/sparc32/soft-fp/q_sub.c index 1987aea480..8616727bb1 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_sub.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_sub.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = a - b - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -30,10 +30,10 @@ long double _Q_sub(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_Q(A, a); - FP_UNPACK_Q(B, b); + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); FP_SUB_Q(C, A, B); - FP_PACK_Q(c, C); + FP_PACK_SEMIRAW_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c b/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c index 77e64b4de7..53c0add2d8 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c @@ -30,8 +30,8 @@ long double _Q_ulltoq(const unsigned long long a) long double c; unsigned long long b = a; - FP_FROM_INT_Q(C, b, 64, long long); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long long); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c b/sysdeps/sparc/sparc32/soft-fp/q_utoq.c index 6efb780cf1..f902bf8397 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_utoq.c @@ -30,8 +30,8 @@ long double _Q_utoq(const unsigned int a) long double c; unsigned int b = a; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_Q(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/sparc/sparc32/sparcv9b/Implies b/sysdeps/sparc/sparc32/sparcv9b/Implies deleted file mode 100644 index 78a424460b..0000000000 --- a/sysdeps/sparc/sparc32/sparcv9b/Implies +++ /dev/null @@ -1 +0,0 @@ -sparc/sparc32/sparcv9 diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_add.c b/sysdeps/sparc/sparc64/soft-fp/qp_add.c index bcfd0ff281..eced23fad8 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_add.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_add.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) + (*b) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,10 +29,10 @@ void _Qp_add(long double *c, const long double *a, const long double *b) FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C); FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); - FP_UNPACK_QP(B, b); + FP_UNPACK_SEMIRAW_QP(A, a); + FP_UNPACK_SEMIRAW_QP(B, b); FP_ADD_Q(C, A, B); - FP_PACK_QP(c, C); + FP_PACK_SEMIRAW_QP(c, C); QP_HANDLE_EXCEPTIONS(__asm ( " ldd [%1], %%f52\n" " ldd [%1+8], %%f54\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c index 9ba2fac9ce..63f3d742aa 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,13 +31,13 @@ void _Qp_dtoq(long double *c, const double a) FP_DECL_Q(C); FP_INIT_ROUNDMODE; - FP_UNPACK_D(A, a); + FP_UNPACK_RAW_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,D,4,2,C,A); + FP_EXTEND(Q,D,4,2,C,A); #else - FP_CONV(Q,D,2,1,C,A); + FP_EXTEND(Q,D,2,1,C,A); #endif - FP_PACK_QP(c, C); + FP_PACK_RAW_QP(c, C); QP_HANDLE_EXCEPTIONS(__asm ( " fdtoq %1, %%f60\n" " std %%f60, [%0]\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c index dd28b6a56e..310d70c77a 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,7 +29,7 @@ void _Qp_itoq(long double *c, const int a) FP_DECL_Q(C); int b = a; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_QP(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_QP(c, C); QP_NO_EXCEPTIONS; } diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c index c86967a5d4..2e5edadcb7 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (double)(*a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ double _Qp_qtod(const long double *a) double r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_SEMIRAW_QP(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(D,Q,2,4,R,A); + FP_TRUNC(D,Q,2,4,R,A); #else - FP_CONV(D,Q,1,2,R,A); + FP_TRUNC(D,Q,1,2,R,A); #endif - FP_PACK_D(r, R); + FP_PACK_SEMIRAW_D(r, R); QP_HANDLE_EXCEPTIONS(__asm ( " ldd [%1], %%f52\n" " ldd [%1+8], %%f54\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c index cf8aba73c6..a40253654a 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (int)(*a) - Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -28,10 +28,10 @@ int _Qp_qtoi(const long double *a) { FP_DECL_EX; FP_DECL_Q(A); - int r; + unsigned int r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_RAW_QP(A, a); FP_TO_INT_Q(r, A, 32, 1); QP_HANDLE_EXCEPTIONS( int rx; diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c index 52d52d6830..f5f9cdb190 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (float)(*a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -32,13 +32,13 @@ float _Qp_qtos(const long double *a) float r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_SEMIRAW_QP(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(S,Q,1,4,R,A); + FP_TRUNC(S,Q,1,4,R,A); #else - FP_CONV(S,Q,1,2,R,A); + FP_TRUNC(S,Q,1,2,R,A); #endif - FP_PACK_S(r, R); + FP_PACK_SEMIRAW_S(r, R); QP_HANDLE_EXCEPTIONS(__asm ( " ldd [%1], %%f52\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c index abee50b06a..884d23e527 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (unsigned int)(*a) - Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,7 +31,7 @@ unsigned int _Qp_qtoui(const long double *a) unsigned int r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_RAW_QP(A, a); FP_TO_INT_Q(r, A, 32, -1); QP_HANDLE_EXCEPTIONS( int rx; diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c index 87c8478880..4b6f265a47 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (unsigned long)(*a) - Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,7 +31,7 @@ unsigned long _Qp_qtoux(const long double *a) unsigned long r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_RAW_QP(A, a); FP_TO_INT_Q(r, A, 64, -1); QP_HANDLE_EXCEPTIONS( unsigned long rx; diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c b/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c index 35481196ee..fac6166c2c 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long)(*a) - Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -28,10 +28,10 @@ long _Qp_qtox(const long double *a) { FP_DECL_EX; FP_DECL_Q(A); - long r; + unsigned long r; FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); + FP_UNPACK_RAW_QP(A, a); FP_TO_INT_Q(r, A, 64, 1); QP_HANDLE_EXCEPTIONS( long rx; diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c index 655813186e..1a4a03df88 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -31,13 +31,13 @@ void _Qp_stoq(long double *c, const float a) FP_DECL_Q(C); FP_INIT_ROUNDMODE; - FP_UNPACK_S(A, a); + FP_UNPACK_RAW_S(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_CONV(Q,S,4,1,C,A); + FP_EXTEND(Q,S,4,1,C,A); #else - FP_CONV(Q,S,2,1,C,A); + FP_EXTEND(Q,S,2,1,C,A); #endif - FP_PACK_QP(c, C); + FP_PACK_RAW_QP(c, C); QP_HANDLE_EXCEPTIONS(__asm ( " fstoq %1, %%f60\n" " std %%f60, [%0]\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_sub.c b/sysdeps/sparc/sparc64/soft-fp/qp_sub.c index b1ed15a588..056224fb46 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_sub.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_sub.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) - (*b) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,10 +29,10 @@ void _Qp_sub(long double *c, const long double *a, const long double *b) FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C); FP_INIT_ROUNDMODE; - FP_UNPACK_QP(A, a); - FP_UNPACK_QP(B, b); + FP_UNPACK_SEMIRAW_QP(A, a); + FP_UNPACK_SEMIRAW_QP(B, b); FP_SUB_Q(C, A, B); - FP_PACK_QP(c, C); + FP_PACK_SEMIRAW_QP(c, C); QP_HANDLE_EXCEPTIONS(__asm ( " ldd [%1], %%f52\n" " ldd [%1+8], %%f54\n" diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c index d143ba28d3..a3bfaedfc9 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,7 +29,7 @@ void _Qp_uitoq(long double *c, const unsigned int a) FP_DECL_Q(C); unsigned int b = a; - FP_FROM_INT_Q(C, b, 32, int); - FP_PACK_QP(c, C); + FP_FROM_INT_Q(C, b, 32, unsigned int); + FP_PACK_RAW_QP(c, C); QP_NO_EXCEPTIONS; } diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c index 302147711c..f691e4d36f 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,7 +29,7 @@ void _Qp_uxtoq(long double *c, const unsigned long a) FP_DECL_Q(C); unsigned long b = a; - FP_FROM_INT_Q(C, b, 64, long); - FP_PACK_QP(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long); + FP_PACK_RAW_QP(c, C); QP_NO_EXCEPTIONS; } diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c b/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c index 9b4d16969e..b7a6102693 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c +++ b/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(*a) - Copyright (C) 1997,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -29,7 +29,7 @@ void _Qp_xtoq(long double *c, const long a) FP_DECL_Q(C); long b = a; - FP_FROM_INT_Q(C, b, 64, long); - FP_PACK_QP(c, C); + FP_FROM_INT_Q(C, b, 64, unsigned long); + FP_PACK_RAW_QP(c, C); QP_NO_EXCEPTIONS; } diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile index c1da42f953..4ab06ba33e 100644 --- a/sysdeps/unix/Makefile +++ b/sysdeps/unix/Makefile @@ -212,24 +212,6 @@ common-generated := $(common-generated) \ bits/ioctls.h ioctls make-ioctls make-ioctls.c endif -ifeq ($(subdir),stdio-common) -ifeq (,$(filter-out $(sysdep_dir)/generic/ $(objpfx),\ - $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/errlist.c)))))) - -before-compile: $(objpfx)errlist.c -$(objpfx)errlist.c: $(objpfx)make_errlist - @rm -f $@ - $(dir $<)$(notdir $<) > $@-tmp - mv $@-tmp $@ - -$(objpfx)make_errlist: $(sysdep_dir)/unix/make_errlist.c - $(native-compile) - -generated := $(generated) make_errlist errlist.c - -endif -endif # stdio-common - ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\ $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/syscall.h)))))) @@ -323,9 +305,6 @@ generated += stub-syscalls.c endif endif -export sysdirs -export asm_CPP := $(COMPILE.S) -E -x assembler-with-cpp - # This is the end of the pipeline for compiling the syscall stubs. # The stdin in assembler with cpp using sysdep.h macros. # Be sure to disable debugging info since it would all just say "<stdin>". @@ -336,7 +315,9 @@ $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \ $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) for dir in $(+sysdep_dirs); do \ test -f $$dir/syscalls.list && \ - { $(SHELL) $(dir $<)$(notdir $<) $$dir || exit 1; }; \ + { sysdirs='$(sysdirs)' \ + asm_CPP='$(COMPILE.S) -E -x assembler-with-cpp' \ + $(SHELL) $(dir $<)$(notdir $<) $$dir || exit 1; }; \ test $$dir = $(..)sysdeps/unix && break; \ done > $@T mv -f $@T $@ diff --git a/sysdeps/unix/bsd/m68k/pipe.S b/sysdeps/unix/bsd/m68k/pipe.S deleted file mode 100644 index d7b8ec28d5..0000000000 --- a/sysdeps/unix/bsd/m68k/pipe.S +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1991,1992,1993,1995,1997,2002 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 <sysdep.h> - -SYSCALL__ (pipe, 1) -#ifdef __motorola__ - move.l 4(sp), a0 - movem.l d0-d1, (a0) -#else - movel sp@(4), a0 - moveml d0-d1, a0@ -#endif - clrl d0 - rts - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/bsd/m68k/start.c b/sysdeps/unix/bsd/m68k/start.c deleted file mode 100644 index 1067853d61..0000000000 --- a/sysdeps/unix/bsd/m68k/start.c +++ /dev/null @@ -1,3 +0,0 @@ -#define DUMMIES ignore0 - -#include <sysdeps/unix/start.c> diff --git a/sysdeps/unix/bsd/m68k/syscall.S b/sysdeps/unix/bsd/m68k/syscall.S deleted file mode 100644 index eb1a8ec7a9..0000000000 --- a/sysdeps/unix/bsd/m68k/syscall.S +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 1993, 1997 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 <sysdep.h> - -ENTRY (syscall) - movel sp@+, a0 /* Pop return address into A0. */ - DO_CALL (sp@, 0) /* Do system call. */ - jmp a0@ /* Return to A0. */ -error: movel a0, sp@- /* Error; push return address */ - jmp syscall_error /* and jump to error handler. */ diff --git a/sysdeps/unix/bsd/m68k/sysdep.S b/sysdeps/unix/bsd/m68k/sysdep.S deleted file mode 100644 index 90f35c9bcc..0000000000 --- a/sysdeps/unix/bsd/m68k/sysdep.S +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1997 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 _ERRNO_H -#include <bits/errno.h> - -.globl syscall_error -syscall_error: - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ -#ifdef __motorola__ -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - cmp.l #EWOULDBLOCK_sys, d0 - bne store - moveq.l #EAGAIN, d0 -#endif -store: move.l d0, _errno - moveq.l #-1, d0 -#else -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - cmpl #EWOULDBLOCK_sys, d0 - bne store - moveq #EAGAIN, d0 -#endif -store: movel d0, _errno - moveq #-1, d0 -#endif - rts diff --git a/sysdeps/unix/bsd/m68k/wait.S b/sysdeps/unix/bsd/m68k/wait.S deleted file mode 100644 index 9fb4fd93bd..0000000000 --- a/sysdeps/unix/bsd/m68k/wait.S +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993, 1995, 1997 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 <sysdep.h> - -SYSCALL__ (wait, 1) -#ifdef __motorola__ - tst.l 4(sp) - beq 1f - movea.l 4(sp), a0 - move.l d1, (a0) -#else - tstl sp@(4) - beq 1f - moveal sp@(4), a0 - movel d1, a0@ -#endif -1: rts - -weak_alias (__wait, wait) diff --git a/sysdeps/unix/common/Makefile b/sysdeps/unix/common/Makefile deleted file mode 100644 index ea3a8d58f2..0000000000 --- a/sysdeps/unix/common/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 1991, 1992, 1993, 1994, 1997 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 inhibit-glue -ifeq ($(subdir),ctype) - -sysdep_routines := $(sysdep_routines) ctype-glue - -generated := $(generated) glue-ctype ctype-glue.c - -$(objpfx)ctype-glue.c: $(objpfx)glue-ctype - @rm -f $@ - $(dir $<)$(notdir $<) > $@-t - mv $@-t $@ - -$(objpfx)glue-ctype: $(sysdep_dir)/unix/common/glue-ctype.c - $(native-compile) - -endif -endif diff --git a/sysdeps/unix/common/configure b/sysdeps/unix/common/configure deleted file mode 100755 index 7bbc9cb2e5..0000000000 --- a/sysdeps/unix/common/configure +++ /dev/null @@ -1,195 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - -if test -z "$inhibit_glue"; then - -# Find out what this system calls `sys_siglist'. - -echo "$as_me:$LINENO: checking for sys_siglist" >&5 -echo $ECHO_N "checking for sys_siglist... $ECHO_C" >&6 -if test "${ac_cv_check_symbol_sys_siglist+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -extern char *sys_siglist[]; puts(*sys_siglist); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_check_symbol_sys_siglist=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_check_symbol_sys_siglist=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - -if test "$ac_cv_check_symbol_sys_siglist" = yes; then - ac_tr_symbol=`echo sys_siglist | tr '[a-z]' '[A-Z]'` - cat >>confdefs.h <<_ACEOF -#define HAVE_${ac_tr_symbol} 1 -_ACEOF - -fi -echo "$as_me:$LINENO: result: $ac_cv_check_symbol_sys_siglist" >&5 -echo "${ECHO_T}$ac_cv_check_symbol_sys_siglist" >&6 -echo "$as_me:$LINENO: checking for _sys_siglist" >&5 -echo $ECHO_N "checking for _sys_siglist... $ECHO_C" >&6 -if test "${ac_cv_check_symbol__sys_siglist+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -extern char *_sys_siglist[]; puts(*_sys_siglist); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_check_symbol__sys_siglist=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_check_symbol__sys_siglist=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - -if test "$ac_cv_check_symbol__sys_siglist" = yes; then - ac_tr_symbol=`echo _sys_siglist | tr '[a-z]' '[A-Z]'` - cat >>confdefs.h <<_ACEOF -#define HAVE_${ac_tr_symbol} 1 -_ACEOF - -fi -echo "$as_me:$LINENO: result: $ac_cv_check_symbol__sys_siglist" >&5 -echo "${ECHO_T}$ac_cv_check_symbol__sys_siglist" >&6 - -# Find out the name of the table the system's <ctype.h> uses for character -# classification. This is used by sysdeps/unix/common/glue-ctype.c. -echo "$as_me:$LINENO: checking ctype array name for glue" >&5 -echo $ECHO_N "checking ctype array name for glue... $ECHO_C" >&6 -if test "${libc_cv_ctype_glue+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ctype in _ctype_ __ctype_ __ctype _ctype__ _ctype _locp; do -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -int -main () -{ -$ctype[13]; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_ctype_glue="$ctype"; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -done -fi - -echo "$as_me:$LINENO: result: $libc_cv_ctype_glue" >&5 -echo "${ECHO_T}$libc_cv_ctype_glue" >&6 -cat >>confdefs.h <<_ACEOF -#define HAVE_`echo $libc_cv_ctype_glue | tr 'a-z' 'A-Z'` 1 -_ACEOF - - -fi diff --git a/sysdeps/unix/common/configure.in b/sysdeps/unix/common/configure.in deleted file mode 100644 index 9597d68f3d..0000000000 --- a/sysdeps/unix/common/configure.in +++ /dev/null @@ -1,21 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. - -if test -z "$inhibit_glue"; then - -# Find out what this system calls `sys_siglist'. -AC_CHECK_SYMBOL(sys_siglist) -AC_CHECK_SYMBOL(_sys_siglist) - -# Find out the name of the table the system's <ctype.h> uses for character -# classification. This is used by sysdeps/unix/common/glue-ctype.c. -AC_MSG_CHECKING(ctype array name for glue) -AC_CACHE_VAL(libc_cv_ctype_glue, [dnl -for ctype in _ctype_ __ctype_ __ctype _ctype__ _ctype _locp; do -AC_TRY_LINK([#include <ctype.h>], - [$ctype[13];], - [libc_cv_ctype_glue="$ctype"; break]) -done]) -AC_MSG_RESULT($libc_cv_ctype_glue) -AC_DEFINE_UNQUOTED(HAVE_`echo $libc_cv_ctype_glue | tr '[a-z]' '[A-Z]'`) - -fi diff --git a/sysdeps/unix/common/glue-ctype.c b/sysdeps/unix/common/glue-ctype.c deleted file mode 100644 index 2e065a77c9..0000000000 --- a/sysdeps/unix/common/glue-ctype.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 1992, 1993, 1994, 1997 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. */ - -/* Different systems have different names for the array. - This order is important for some systems. */ - -#if !defined(TABLE) && defined(HAVE__LOCP) -/* OSF/1 has the name _ctype defined as a macro, which points down into - the _locp structure. Jesus. We'll hope this works. We need to - check for LOCP first, since there is no symbol actually named _ctype - in their library. */ -#include <sys/types.h> /* for wchar_t used by localdef.h */ -#include <sys/localedef.h> -extern loc_t *_locp; -#define TABLE (_locp->lc_chrtbl)->lc_ctype -#undef _ctype -#define TABLE_NAME _ctype -#endif -#ifdef HAVE__CTYPE__ -#define TABLE _ctype__ -#endif -#if !defined(TABLE) && defined(HAVE__CTYPE) -#define TABLE _ctype -#endif -#if !defined(TABLE) && defined(HAVE__CTYPE_) -#define TABLE _ctype_ -#endif -#if !defined(TABLE) && defined(HAVE___CTYPE_) -#define TABLE __ctype_ -#endif -#if !defined(TABLE) && defined(HAVE___CTYPE) -#define TABLE __ctype -#endif - -#if defined (__STDC__) && __STDC__ -#define STRINGIFY(arg) #arg -#else -#define STRINGIFY(arg) "arg" -#endif - -#define EVALLED_STRINGIFY(x) STRINGIFY (x) - -int -main () -{ -#ifdef TABLE - - int i; - -#ifndef HAVE__LOCP - /* This won't work for the define to look into _locp. */ - extern unsigned char TABLE[]; -#endif - -#ifdef TABLE_NAME - printf ("const unsigned char %s[] =\n {\n", EVALLED_STRINGIFY (TABLE_NAME)); -#else - printf ("const unsigned char %s[] =\n {\n", EVALLED_STRINGIFY (TABLE)); -#endif - - for (i = -1; i < 256; ++i) - printf (" %d,\n", (int) ((TABLE+1)[i])); - - puts (" };"); - -#else - - puts ("/* I don't know what the ctype table is called on this system."); - puts (" If there is a table, and you want the ctype glue to work,"); - puts (" edit configure.in and glue-ctype.c in sysdeps/unix/common/"); - puts (" to check for the right name. */"); - -#endif - - exit (0); -} diff --git a/sysdeps/unix/configure b/sysdeps/unix/configure deleted file mode 100755 index b910353cd9..0000000000 --- a/sysdeps/unix/configure +++ /dev/null @@ -1,109 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/unix. - -if test -z "$inhibit_glue"; then -# For make_errlist.c, used in make_errlist. - - -for ac_func in strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -fi diff --git a/sysdeps/unix/configure.in b/sysdeps/unix/configure.in deleted file mode 100644 index de7feccb25..0000000000 --- a/sysdeps/unix/configure.in +++ /dev/null @@ -1,7 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/unix. - -if test -z "$inhibit_glue"; then -# For make_errlist.c, used in make_errlist. -AC_CHECK_FUNCS(strerror) -fi diff --git a/sysdeps/unix/make_errlist.c b/sysdeps/unix/make_errlist.c deleted file mode 100644 index 8b2b972a8a..0000000000 --- a/sysdeps/unix/make_errlist.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (C) 1991,1992,1995,1997,1999,2001 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 <stdio.h> -#include <time.h> - -/* Make a definition for sys_errlist. */ - -extern int sys_nerr; -#ifndef HAVE_STRERROR -extern const char *const sys_errlist[]; -#endif - -int -main (void) -{ - register int i; - struct tm timenow; - time_t now; - int year; - - now = time (NULL); - timenow = *localtime (&now); - - year = timenow.tm_year + 1900; - - printf ("/* Copyright (C) %d Free Software Foundation, Inc.\n\ - This file is part of the GNU C Library.\n\ -\n\ - The GNU C Library is free software; you can redistribute it and/or\n\ - modify it under the terms of the GNU Lesser General Public\n\ - License as published by the Free Software Foundation; either\n\ - version 2.1 of the License, or (at your option) any later version.\n\ -\n\ - The GNU C Library is distributed in the hope that it will be useful,\n\ - but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n\ - Lesser General Public License for more details.\n\ -\n\ - You should have received a copy of the GNU Lesser General Public\n\ - License along with the GNU C Library; if not, write to the Free\n\ - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n\ - 02111-1307 USA. */\n", year); - - puts ("#include <stddef.h>\n"); - puts ("#include <libintl.h>\n"); - puts ("\n/* This is a list of all known `errno' codes. */\n"); - - printf ("\nconst int _sys_nerr = %d;\n\n", sys_nerr); - puts ("const char *const _sys_errlist[] =\n {"); - - for (i = 0; i < sys_nerr; ++i) - printf (" N_(\"%s\"),\n", -#ifdef HAVE_STRERROR - strerror (i) -#else /* ! HAVE_STRERROR */ - sys_errlist[i] -#endif /* HAVE_STRERROR */ - ); - - puts (" NULL\n };\n"); - - puts ("weak_alias (_sys_errlist, sys_errlist)"); - puts ("weak_alias (_sys_nerr, sys_nerr)"); - - exit (0); -} diff --git a/sysdeps/unix/mips/brk.S b/sysdeps/unix/mips/brk.S deleted file mode 100644 index a35b8b9113..0000000000 --- a/sysdeps/unix/mips/brk.S +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> -#include <sys/asm.h> - -#ifndef SYS_brk -#define SYS_brk 17 -#endif - -#ifndef HAVE_GNU_LD -#define _end end -#endif - - .data -ENTRY(__curbrk) - .word 0 - .end __curbrk - - .text -SYSCALL__(brk, 1) - .set reorder - /* Handle the query case. */ - bnez a0, 1f - move a0, v0 -1: /* Update __curbrk and exit cleanly. */ - PTR_S a0, __curbrk - move v0, zero - jr ra -PSEUDO_END(__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/mips/dl-brk.S b/sysdeps/unix/mips/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/mips/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include <brk.S> diff --git a/sysdeps/unix/mips/fork.S b/sysdeps/unix/mips/fork.S deleted file mode 100644 index a7848acb6b..0000000000 --- a/sysdeps/unix/mips/fork.S +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> - -SYSCALL__ (fork, 0) - beq v1, zero, parent /* Branch if parent. */ - nop - /* We are the child. Return zero. */ - move v0, zero -parent: - ret -PSEUDO_END(__fork) - -libc_hidden_def (__fork) -weak_alias (__fork, fork) diff --git a/sysdeps/unix/mips/mips32/sysdep.h b/sysdeps/unix/mips/mips32/sysdep.h deleted file mode 100644 index 0b5d1186bb..0000000000 --- a/sysdeps/unix/mips/mips32/sysdep.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdeps/unix/mips/sysdep.h> - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99: la t9,__syscall_error; \ - jr t9; \ - ENTRY(name) \ - .set noreorder; \ - .cpload t9; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - nop; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif diff --git a/sysdeps/unix/mips/mips64/n32/sysdep.h b/sysdeps/unix/mips/mips64/n32/sysdep.h deleted file mode 100644 index ec93fadc04..0000000000 --- a/sysdeps/unix/mips/mips64/n32/sysdep.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com>. - - 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 <sysdeps/unix/mips/sysdep.h> - -#ifdef __ASSEMBLER__ - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99:; \ - .set noat; \ - .cpsetup t9, $1, name; \ - .set at; \ - la t9,__syscall_error; \ - .cpreturn; \ - jr t9; \ - ENTRY(name) \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif - -#endif diff --git a/sysdeps/unix/mips/mips64/n64/sysdep.h b/sysdeps/unix/mips/mips64/n64/sysdep.h deleted file mode 100644 index 502b66797b..0000000000 --- a/sysdeps/unix/mips/mips64/n64/sysdep.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com>. - - 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 <sysdeps/unix/mips/sysdep.h> - -#ifdef __ASSEMBLER__ - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99:; \ - .set noat; \ - .cpsetup t9, $1, name; \ - .set at; \ - dla t9,__syscall_error; \ - .cpreturn; \ - jr t9; \ - ENTRY(name) \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif - -#endif diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S deleted file mode 100644 index ee7b76d635..0000000000 --- a/sysdeps/unix/mips/pipe.S +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> - -SYSCALL__ (pipe, 1) - /* Plop in the two descriptors. */ - sw v0, 0(a0) - sw v1, 4(a0) - - /* Go out with a clean status. */ - move v0, zero - j ra -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/mips/rt-sysdep.S b/sysdeps/unix/mips/rt-sysdep.S deleted file mode 100644 index f966bf1e59..0000000000 --- a/sysdeps/unix/mips/rt-sysdep.S +++ /dev/null @@ -1 +0,0 @@ -#include <sysdep.S> diff --git a/sysdeps/unix/mips/sigreturn.S b/sysdeps/unix/mips/sigreturn.S deleted file mode 100644 index 2cb3adb6de..0000000000 --- a/sysdeps/unix/mips/sigreturn.S +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> - -#ifndef SYS_sigreturn -#define SYS_sigreturn 103 -#endif - -ENTRY(__sigreturn) - li v0, SYS_sigreturn - syscall - .end __sigreturn - -weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S deleted file mode 100644 index 8c172db190..0000000000 --- a/sysdeps/unix/mips/sysdep.S +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> -#define _ERRNO_H -#include <bits/errno.h> -#include <sys/asm.h> - -#ifdef _LIBC_REENTRANT - -LOCALSZ= 3 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -RAOFF= FRAMESZ-(1*SZREG) -GPOFF= FRAMESZ-(2*SZREG) -V0OFF= FRAMESZ-(3*SZREG) - -ENTRY(__syscall_error) -#ifdef __PIC__ - .set noat - SETUP_GPX (AT) - .set at -#endif - PTR_SUBU sp, FRAMESZ - .set noat - SETUP_GPX64(GPOFF,AT) - .set at -#ifdef __PIC__ - SAVE_GP(GPOFF) -#endif - REG_S v0, V0OFF(sp) - REG_S ra, RAOFF(sp) - -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ - bne v0, EWOULDBLOCK_sys, L(skip) - nop - li v0, EAGAIN -L(skip): -#endif - /* Find our per-thread errno address */ - jal __errno_location - - /* Store the error value. */ - REG_L t0, V0OFF(sp) - sw t0, 0(v0) - - /* And just kick back a -1. */ - REG_L ra, RAOFF(sp) - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - li v0, -1 - j ra - END(__syscall_error) - -#else /* _LIBC_REENTRANT */ - - -ENTRY(__syscall_error) -#ifdef __PIC__ - SETUP_GPX (AT) -#endif - SETUP_GPX64 (t9, AT) - -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ - bne v0, EWOULDBLOCK_sys, L(skip) - li v0, EAGAIN -L(skip): -#endif - /* Store it in errno... */ - sw v0, errno - - /* And just kick back a -1. */ - li v0, -1 - - RESTORE_GP64 - j ra - END(__syscall_error) -#endif /* _LIBC_REENTRANT */ diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h deleted file mode 100644 index 714830147d..0000000000 --- a/sysdeps/unix/mips/sysdep.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sgidefs.h> -#include <sysdeps/unix/sysdep.h> - -#ifdef __ASSEMBLER__ - -#include <regdef.h> - -#define ENTRY(name) \ - .globl name; \ - .align 2; \ - .ent name,0; \ - name##: - -#undef END -#define END(function) \ - .end function; \ - .size function,.-function - -#define ret j ra ; nop - -#undef PSEUDO_END -#define PSEUDO_END(sym) .end sym; .size sym,.-sym - -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - .align 2; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall - -#undef PSEUDO_END_NOERRNO -#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym - -#define ret_NOERRNO ret - -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - .align 2; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall - -#undef PSEUDO_END_ERRVAL -#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym - -#define ret_ERRVAL ret - -#define r0 v0 -#define r1 v1 -/* The mips move insn is d,s. */ -#define MOVE(x,y) move y , x - -#if _MIPS_SIM == _ABIO32 -# define L(label) $L ## label -#else -# define L(label) .L ## label -#endif - -#endif diff --git a/sysdeps/unix/mips/wait.S b/sysdeps/unix/mips/wait.S deleted file mode 100644 index de0f6ebfae..0000000000 --- a/sysdeps/unix/mips/wait.S +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1992, 1994, 1995, 1997, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - 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 <sysdep.h> - -.set noreorder - -ENTRY(__wait) - /* Prep it for wait. */ - move a1, zero - move a2, zero - - li v0, SYS_wait - syscall - beqz a3, L(noerror) - nop - j __syscall_error - nop - -L(noerror): - /* If the arg is not NULL, store v1 there. */ - beqz a0, L(noarg) - nop - sw v1, 0(a0) - nop -L(noarg): - ret - .end __wait - -weak_alias (__wait, wait) diff --git a/sysdeps/unix/sysv/linux/alpha/fpu/Implies b/sysdeps/unix/sysv/linux/alpha/fpu/Implies deleted file mode 100644 index d76f511c2e..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/fpu/Implies +++ /dev/null @@ -1,2 +0,0 @@ -# Override ldbl-opt with alpha specific routines. -alpha/fpu diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c index 4cb304cb40..497694619a 100644 --- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c +++ b/sysdeps/unix/sysv/linux/alpha/fxstatat.c @@ -94,5 +94,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) return -1; } -strong_alias (__fxstatat, __fxstatat64) -strong_alias (__fxstatat64, __GI___fxstatat64) +libc_hidden_def (__fxstatat) +strong_alias (__fxstatat, __fxstatat64); +libc_hidden_ver(__fxstatat, __fxstatat64); diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c index 2aa4ad54be..60e7ae0ac7 100644 --- a/sysdeps/unix/sysv/linux/ftruncate64.c +++ b/sysdeps/unix/sysv/linux/ftruncate64.c @@ -73,5 +73,5 @@ weak_alias (__ftruncate64, ftruncate64) #else /* Use the generic implementation. */ -# include <posix/ftruncate64.c> +# include <misc/ftruncate64.c> #endif diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile deleted file mode 100644 index 1c93ec52d9..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# linux/hppa does not use -lmilli anymore -gnulib := -lgcc diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions deleted file mode 100644 index e15c8225fb..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/Versions +++ /dev/null @@ -1,25 +0,0 @@ -libc { - # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk. - # When you get an error from errlist-compat.awk, you need to add a new - # version here. Don't do this blindly, since this means changing the ABI - # for all GNU/Linux configurations. - - GLIBC_2.1 { - #errlist-compat 253 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - } - GLIBC_2.2 { - # New rlimit interface - getrlimit; setrlimit; getrlimit64; setrlimit64; - } - GLIBC_2.3 { - #errlist-compat 254 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - } -} -librt { - GLIBC_2.3 { - # AIO functions. - aio_cancel; aio_cancel64; - } -} diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h deleted file mode 100644 index 003d71f622..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/errno.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Error constants. Linux/HPPA specific version. - Copyright (C) 1996,1997,1998,1999,2000,2002 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. */ - -#ifdef _ERRNO_H - -# undef EDOM -# undef EILSEQ -# undef ERANGE -# include <linux/errno.h> - -/* Linux also has no ECANCELED error code. Since it is not used here - we define it to an invalid value. */ -# ifndef ECANCELED -# define ECANCELED ECANCELLED -# endif - -# ifndef __ASSEMBLER__ -/* Function to get address of global `errno' variable. */ -extern int *__errno_location (void) __THROW __attribute__ ((__const__)); - -# if !defined _LIBC || defined _LIBC_REENTRANT -/* When using threads, errno is a per-thread value. */ -# define errno (*__errno_location ()) -# endif -# endif /* !__ASSEMBLER__ */ -#endif /* _ERRNO_H */ - -#if !defined _ERRNO_H && defined __need_Emath -/* This is ugly but the kernel header is not clean enough. We must - define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is - defined. */ -# define EDOM 33 /* Math argument out of domain of function. */ -# define EILSEQ 47 /* Illegal byte sequence. */ -# define ERANGE 34 /* Math result not representable. */ -#endif /* !_ERRNO_H && __need_Emath */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h deleted file mode 100644 index 9d967c6475..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h +++ /dev/null @@ -1,181 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux/HPPA. - Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2004 - 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 _FCNTL_H -# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." -#endif - -#include <sys/types.h> - - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_RDONLY 00000000 -#define O_WRONLY 00000001 -#define O_RDWR 00000002 -#define O_ACCMODE 00000003 -#define O_APPEND 00000010 -#define O_BLKSEEK 00000100 /* HPUX only */ -#define O_CREAT 00000400 /* not fcntl */ -#define O_TRUNC 00001000 /* not fcntl */ -#define O_EXCL 00002000 /* not fcntl */ -#define O_ASYNC 00020000 -#define O_SYNC 00100000 -#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ -#define O_NDELAY O_NONBLOCK -#define O_NOCTTY 00400000 /* not fcntl */ - - -#ifdef __USE_GNU -# define O_DIRECT 00040000 /* direct disk access hint - currently ignored */ -# define O_DIRECTORY 00010000 /* must be a directory */ -# define O_NOFOLLOW 00000200 /* don't follow links */ -# define O_NOATIME 04000000 /* Do not set atime. */ -#endif - -#ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 00004000 -#endif - -#if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC 01000000 /* HPUX only */ -# define O_RSYNC 02000000 /* HPUX only */ -#endif - -/* Values for the second argument to `fcntl'. */ -#define F_DUPFD 0 /* Duplicate file descriptor. */ -#define F_GETFD 1 /* Get file descriptor flags. */ -#define F_SETFD 2 /* Set file descriptor flags. */ -#define F_GETFL 3 /* Get file status flags. */ -#define F_SETFL 4 /* Set file status flags. */ -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 5 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ -#endif - -#define F_GETLK64 8 /* Get record locking info. */ -#define F_SETLK64 9 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 10 /* Set record locking info (blocking). */ - -#if defined __USE_BSD || defined __USE_UNIX98 -# define F_GETOWN 11 /* Get owner of socket (receiver of SIGIO). */ -# define F_SETOWN 12 /* Set owner of socket (receiver of SIGIO). */ -#endif - -#ifdef __USE_GNU -# define F_SETSIG 13 /* Set number of signal to be sent. */ -# define F_GETSIG 14 /* Get number of signal to be sent. */ -#endif - -#ifdef __USE_GNU -# define F_SETLEASE 1024 /* Set a lease. */ -# define F_GETLEASE 1025 /* Enquire what lease is active. */ -# define F_NOTIFY 1026 /* Request notfications on a directory. */ -#endif - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* 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. */ - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -#ifdef __USE_BSD -/* operations for bsd flock(), also used by the kernel implementation */ -# define LOCK_SH 1 /* shared lock */ -# define LOCK_EX 2 /* exclusive lock */ -# define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -# define LOCK_UN 8 /* remove lock */ -#endif - -#ifdef __USE_GNU -/* Types of directory notifications that may be requested with F_NOTIFY. */ -# define DN_ACCESS 0x00000001 /* File accessed. */ -# define DN_MODIFY 0x00000002 /* File modified. */ -# define DN_CREATE 0x00000004 /* File created. */ -# define DN_DELETE 0x00000008 /* File removed. */ -# define DN_RENAME 0x00000010 /* File renamed. */ -# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ -# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ -#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 - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -# define FAPPEND O_APPEND -# define FFSYNC O_FSYNC -# define FASYNC O_ASYNC -# define FNONBLOCK O_NONBLOCK -# define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -/* Advise to `posix_fadvise'. */ -#ifdef __USE_XOPEN2K -# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ -# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ -#endif - -__BEGIN_DECLS - -/* Provide kernel hint to read ahead. */ -extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) - __THROW; - -__END_DECLS diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h deleted file mode 100644 index 6f4e05fcc8..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1996, 1997 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 _SYS_IOCTL_H -# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead." -#endif - -/* Use the definitions from the kernel header files. */ -#include <asm/ioctls.h> - -/* 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', 16, char[36]) -#define TCSETS _IOW ('T', 17, char[36]) -#define TCSETSW _IOW ('T', 18, char[36]) -#define TCSETSF _IOW ('T', 19, char[36]) - -#include <linux/sockios.h> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h deleted file mode 100644 index d80cf06993..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 1995-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 _SYS_IPC_H -# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." -#endif - -#include <bits/types.h> -#include <bits/wordsize.h> - -/* Mode bits for `msgget', `semget', and `shmget'. */ -#define IPC_CREAT 01000 /* Create key if key does not exist. */ -#define IPC_EXCL 02000 /* Fail if key exists. */ -#define IPC_NOWAIT 04000 /* Return error on wait. */ - -/* Control commands for `msgctl', `semctl', and `shmctl'. */ -#define IPC_RMID 0 /* Remove identifier. */ -#define IPC_SET 1 /* Set `ipc_perm' options. */ -#define IPC_STAT 2 /* Get `ipc_perm' options. */ -#ifdef __USE_GNU -# define IPC_INFO 3 /* See ipcs. */ -#endif - -/* Special key values. */ -#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ - - -/* 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. */ -#if __WORDSIZE == 32 - unsigned short int __pad1; - unsigned short int mode; /* Read/write permission. */ - unsigned short int __pad2; -#else - __mode_t mode; /* Read/write permission. */ - unsigned short int __pad2; -#endif - unsigned short int __seq; /* Sequence number. */ - unsigned int __pad3; - unsigned long long int __unused1; - unsigned long long int __unused2; - }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h deleted file mode 100644 index 1eb1233814..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux/HPPA version. - Copyright (C) 1997, 1998, 2000, 2003 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 _SYS_MMAN_H -# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." -#endif - -/* these are basically taken from the kernel definitions */ - -#define PROT_READ 0x1 /* page can be read */ -#define PROT_WRITE 0x2 /* page can be written */ -#define PROT_EXEC 0x4 /* page can be executed */ -#define PROT_NONE 0x0 /* page can not be accessed */ -#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of - growsdown vma (mprotect only). */ -#define PROT_GROWSUP 0x02000000 /* Extend change to start of - growsup vma (mprotect only). */ - -#define MAP_SHARED 0x01 /* Share changes */ -#define MAP_PRIVATE 0x02 /* Changes are private */ -#define MAP_TYPE 0x03 /* Mask for type of mapping */ -#define MAP_FIXED 0x04 /* Interpret addr exactly */ -#define MAP_ANONYMOUS 0x10 /* don't use a file */ - -#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -#define MAP_LOCKED 0x2000 /* pages are locked */ -#define MAP_NORESERVE 0x4000 /* don't check for reservations */ -#define MAP_GROWSDOWN 0x8000 /* stack-like segment */ -#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ -#define MAP_NONBLOCK 0x20000 /* do not block on IO */ - -#define MS_SYNC 1 /* synchronous memory sync */ -#define MS_ASYNC 2 /* sync memory asynchronously */ -#define MS_INVALIDATE 4 /* invalidate the caches */ - -#define MCL_CURRENT 1 /* lock all current mappings */ -#define MCL_FUTURE 2 /* lock all future mappings */ - -#define MADV_NORMAL 0 /* no further special treatment */ -#define MADV_RANDOM 1 /* expect random page references */ -#define MADV_SEQUENTIAL 2 /* expect sequential page references */ -#define MADV_WILLNEED 3 /* will need these pages */ -#define MADV_DONTNEED 4 /* dont need these pages */ -#define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ -#define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ -#define MADV_VPS_INHERIT 7 /* Inherit parents page size */ - -/* The range 12-64 is reserved for page size specification. */ -#define MADV_4K_PAGES 12 /* Use 4K pages */ -#define MADV_16K_PAGES 14 /* Use 16K pages */ -#define MADV_64K_PAGES 16 /* Use 64K pages */ -#define MADV_256K_PAGES 18 /* Use 256K pages */ -#define MADV_1M_PAGES 20 /* Use 1 Megabyte pages */ -#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */ -#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */ -#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */ - -/* compatibility flags */ -#define MAP_ANON MAP_ANONYMOUS -#define MAP_FILE 0 -#define MAP_VARIABLE 0 - -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -#endif diff --git a/sysdeps/unix/sysv/linux/hppa/bits/msq.h b/sysdeps/unix/sysv/linux/hppa/bits/msq.h deleted file mode 100644 index 1268dc858c..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/msq.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 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 _SYS_MSG_H -# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." -#endif - -#include <bits/types.h> -#include <bits/wordsize.h> - -/* Define options for message queue functions. */ -#define MSG_NOERROR 010000 /* no error if message is too big */ -#ifdef __USE_GNU -# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ -#endif - -/* Types used in the structure definition. */ -typedef unsigned long int msgqnum_t; -typedef unsigned long int msglen_t; - - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __WORDSIZE == 32 - unsigned int __pad1; -#endif - __time_t msg_stime; /* time of last msgsnd command */ -#if __WORDSIZE == 32 - unsigned int __pad2; -#endif - __time_t msg_rtime; /* time of last msgrcv command */ -#if __WORDSIZE == 32 - unsigned int __pad3; -#endif - __time_t msg_ctime; /* time of last change */ - unsigned long int __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() */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -#ifdef __USE_MISC - -# define msg_cbytes __msg_cbytes - -/* ipcs ctl commands */ -# define MSG_STAT 11 -# define MSG_INFO 12 - -/* buffer for msgctl calls IPC_INFO, MSG_INFO */ -struct msginfo - { - int msgpool; - int msgmap; - int msgmax; - int msgmnb; - int msgmni; - int msgssz; - int msgtql; - unsigned short int msgseg; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sem.h b/sysdeps/unix/sysv/linux/hppa/bits/sem.h deleted file mode 100644 index 2880765108..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/sem.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 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 _SYS_SEM_H -# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." -#endif - -#include <sys/types.h> -#include <bits/wordsize.h> - -/* Flags for `semop'. */ -#define SEM_UNDO 0x1000 /* undo the operation on exit */ - -/* Commands for `semctl'. */ -#define GETPID 11 /* get sempid */ -#define GETVAL 12 /* get semval */ -#define GETALL 13 /* get all semval's */ -#define GETNCNT 14 /* get semncnt */ -#define GETZCNT 15 /* get semzcnt */ -#define SETVAL 16 /* set semval */ -#define SETALL 17 /* set all semval's */ - - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ -#if __WORDSIZE == 32 - unsigned int __pad1; -#endif - __time_t sem_otime; /* last semop() time */ -#if __WORDSIZE == 32 - unsigned int __pad2; -#endif - __time_t sem_ctime; /* last time changed by semctl() */ - unsigned long int sem_nsems; /* number of semaphores in set */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -/* The user should define a union like the following to use it for arguments - for `semctl'. - - union semun - { - int val; <= value for SETVAL - struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET - unsigned short int *array; <= array for GETALL & SETALL - struct seminfo *__buf; <= buffer for IPC_INFO - }; - - Previous versions of this file used to define this union but this is - incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether - one must define the union or not. */ -#define _SEM_SEMUN_UNDEFINED 1 - -#ifdef __USE_MISC - -/* ipcs ctl cmds */ -# define SEM_STAT 18 -# define SEM_INFO 19 - -struct seminfo -{ - int semmap; - int semmni; - int semmns; - int semmnu; - int semmsl; - int semopm; - int semume; - int semusz; - int semvmx; - int semaem; -}; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/sysdeps/unix/sysv/linux/hppa/bits/shm.h deleted file mode 100644 index a91f1f575b..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/shm.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 2000, 2002 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 _SYS_SHM_H -# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." -#endif - -#include <bits/types.h> -#include <bits/wordsize.h> - -/* Permission flag for shmget. */ -#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ -#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ - -/* Flags for `shmat'. */ -#define SHM_RDONLY 010000 /* attach read-only else read-write */ -#define SHM_RND 020000 /* round attach address to SHMLBA */ -#define SHM_REMAP 040000 /* take-over region on attach */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - -/* Segment low boundary address multiple. */ -#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */ - -/* Type to count number of attaches. */ -typedef unsigned long int shmatt_t; - -/* Data structure describing a set of semaphores. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ -#if __WORDSIZE == 32 - unsigned int __pad1; -#endif - __time_t shm_atime; /* time of last shmat() */ -#if __WORDSIZE == 32 - unsigned int __pad2; -#endif - __time_t shm_dtime; /* time of last shmdt() */ -#if __WORDSIZE == 32 - unsigned int __pad3; -#endif - __time_t shm_ctime; /* time of last change by shmctl() */ -#if __WORDSIZE == 32 - unsigned int __pad4; -#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 */ - unsigned long int __unused1; - unsigned long int __unused2; - }; - -#ifdef __USE_MISC - -/* ipcs ctl commands */ -# define SHM_STAT 13 -# define SHM_INFO 14 - -/* shm_mode upper byte flags */ -# define SHM_DEST 01000 /* segment will be destroyed on last detach */ -# define SHM_LOCKED 02000 /* segment will not be swapped */ -# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ -# define SHM_NORESERVE 010000 /* don't check for reservations */ - -struct shminfo - { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; - }; - -struct shm_info - { - int used_ids; - unsigned long int shm_tot; /* total allocated shm */ - unsigned long int shm_rss; /* total resident shm */ - unsigned long int shm_swp; /* total swapped shm */ - unsigned long int swap_attempts; - unsigned long int swap_successes; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h deleted file mode 100644 index 33f2b237b7..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Definitions for Linux/HPPA sigaction. - Copyright (C) 1996, 1997, 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 _SIGNAL_H -# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." -#endif - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ -#ifdef __USE_POSIX199309 - 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 - - /* Special flags. */ - unsigned long int sa_flags; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - }; - -/* Bits in `sa_flags'. */ - -#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ -#define SA_NOCLDWAIT 0x00000080 /* Don't create zombie on child death. */ -#define SA_SIGINFO 0x00000010 /* Invoke signal-catching function with - three arguments instead of one. */ -#if defined __USE_UNIX98 || defined __USE_MISC -# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ -# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */ -# define SA_NODEFER 0x00000020 /* Don't automatically block the signal - when its handler is being executed. */ -# define SA_RESTART 0x00000040 /* Restart syscall on signal return. */ -#endif -#ifdef __USE_MISC -# define SA_INTERRUPT 0x20000000 /* Historic 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 0 /* for blocking signals */ -#define SIG_UNBLOCK 1 /* for unblocking signals */ -#define SIG_SETMASK 2 /* for setting the signal mask */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/signum.h b/sysdeps/unix/sysv/linux/hppa/bits/signum.h deleted file mode 100644 index bf46006c8d..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/signum.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Signal number definitions. Linux/HPPA version. - Copyright (C) 1995,1996,1997,1998,1999,2003 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. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -#ifdef __USE_UNIX98 -# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ -#endif - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGABRT 6 /* Abort (ANSI). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* BUS error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad system call. */ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGPWR 19 /* Power failure restart (System V). */ -#define SIGVTALRM 20 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 21 /* Profiling alarm clock (4.2 BSD). */ -#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ -#define SIGIO 22 /* I/O now possible (4.2 BSD). */ -#define SIGWINCH 23 /* Window size change (4.3 BSD, Sun). */ -#define SIGSTOP 24 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 25 /* Keyboard stop (POSIX). */ -#define SIGCONT 26 /* Continue (POSIX). */ -#define SIGTTIN 27 /* Background read from tty (POSIX). */ -#define SIGTTOU 28 /* Background write to tty (POSIX). */ -#define SIGURG 29 /* Urgent condition on socket (4.2 BSD). */ -#define SIGLOST 30 /* Operating System Has Lost (HP/UX). */ -#define SIGUNUSED 31 -#define SIGXCPU 33 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 34 /* File size limit exceeded (4.2 BSD). */ -#define SIGSTKFLT 36 /* Stack fault. */ - -#define _NSIG 65 /* Biggest signal number + 1 - (including real-time signals). */ - -#define SIGRTMIN (__libc_current_sigrtmin ()) -#define SIGRTMAX (__libc_current_sigrtmax ()) - -/* These are the hard limits of the kernel. These values should not be - used directly at user level. */ -#define __SIGRTMIN 37 -#define __SIGRTMAX (_NSIG - 1) - -#endif /* <signal.h> included. */ diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S deleted file mode 100644 index f497bca13d..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/clone.S +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000. - Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996. - - 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. */ - -/* clone() is even more special than fork() as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <asm/unistd.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */ - - .text -ENTRY(__clone) - /* FIXME: I have no idea how profiling works on hppa. */ - - /* Sanity check arguments. */ - comib,= 0,%arg0,.Lerror /* no NULL function pointers */ - ldi -EINVAL,%ret0 - comib,= 0,%arg1,.Lerror /* no NULL stack pointers */ - nop - - /* Save the fn ptr and arg on the new stack. */ - stwm %arg0,64(%arg1) - stw %arg3,-60(%arg1) - - /* Save the PIC register. */ -#ifdef PIC - stw %r19,-32(%sr0, %sp) /* parent */ -#endif - - /* Do the system call */ - copy %arg2,%arg0 - ble 0x100(%sr2,%r0) - ldi __NR_clone,%r20 - - ldi -4096,%r1 - comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */ - b,n .Lerror - - comib,=,n 0,%ret0,thread_start - - /* Successful return from the parent - No need to restore the PIC register, - since we return immediately. */ - - bv %r0(%rp) - nop - - /* Something bad happened -- no child created */ -.Lerror: - - /* Restore the PIC register on error */ -#ifdef PIC - ldw -32(%sr0, %sp), %r19 /* parent */ -#endif - - b __syscall_error - sub %r0,%ret0,%arg0 - -thread_start: - - /* Load up the arguments. */ - ldw -60(%sr0, %sp),%arg0 - ldw -64(%sr0, %sp),%r22 - - /* $$dyncall fixes childs PIC register */ - - /* Call the user's function */ - bl $$dyncall,%r31 - copy %r31,%rp - - bl _exit,%rp - copy %ret0,%arg0 - - /* Die horribly. */ - iitlbp %r0,(%r0) - -PSEUDO_END(__clone) - -weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/hppa/fcntl.c b/sysdeps/unix/sysv/linux/hppa/fcntl.c deleted file mode 100644 index ea951bc4f9..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/fcntl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/sysdeps/unix/sysv/linux/hppa/getdents64.c b/sysdeps/unix/sysv/linux/hppa/getdents64.c deleted file mode 100644 index 0c75fb5a06..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/getdents64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c deleted file mode 100644 index fef018f471..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h deleted file mode 100644 index af048cbe7d..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h +++ /dev/null @@ -1,18 +0,0 @@ -/* We have a separate header file here because we do not support - SA_RESTORER on hppa. */ - -/* This is the sigaction struction from the Linux 2.1.20 kernel. */ -/* Blah. This is bogus. We don't ever use it. */ -struct old_kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned long sa_flags; -}; - -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ - -struct kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_flags; - sigset_t sa_mask; -}; diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h deleted file mode 100644 index a85c5be464..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h +++ /dev/null @@ -1,31 +0,0 @@ -/* definition of "struct stat" from the kernel */ -struct kernel_stat { - unsigned long st_dev; /* dev_t is 32 bits on parisc */ - unsigned long st_ino; /* 32 bits */ - unsigned short st_mode; /* 16 bits */ - unsigned short st_nlink; /* 16 bits */ - unsigned short st_reserved1; /* old st_uid */ - unsigned short st_reserved2; /* old st_gid */ - unsigned long st_rdev; - unsigned long st_size; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - long st_blksize; - long st_blocks; - unsigned long __unused1; /* ACL stuff */ - unsigned long __unused2; /* network */ - unsigned long __unused3; /* network */ - unsigned long __unused4; /* cnodes */ - unsigned short __unused5; /* netsite */ - short st_fstype; - unsigned long st_realdev; - unsigned short st_basemode; - unsigned short st_spareshort; - unsigned long st_uid; - unsigned long st_gid; - unsigned long st_spare4[3]; -}; - -#define _HAVE_STAT_NSEC -#define _HAVE_STAT64_NSEC diff --git a/sysdeps/unix/sysv/linux/hppa/mmap.c b/sysdeps/unix/sysv/linux/hppa/mmap.c deleted file mode 100644 index 6f4bfdce2a..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/mmap.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997 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 <sys/types.h> -#include <sys/mman.h> -#include <errno.h> - -/* Map addresses starting near ADDR and extending for LEN bytes. From - OFFSET into the file FD describes according to PROT and FLAGS. If ADDR - is nonzero, it is the desired mapping address. If the MAP_FIXED bit is - set in FLAGS, the mapping will be at ADDR exactly (which must be - page-aligned); otherwise the system chooses a convenient nearby address. - The return value is the actual mapping address chosen or MAP_FAILED - for errors (in which case `errno' is set). A successful `mmap' call - deallocates any previous mapping for the affected region. */ - -#include <sysdep.h> - -__ptr_t -__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) -{ - - __ptr_t ret; - - ret = INLINE_SYSCALL(mmap, 6, addr, len, prot, flags, fd, offset); - - /* check if it's really a negative number */ - if(((unsigned long)ret & 0xfffff000) == 0xfffff000) - return MAP_FAILED; - - return ret; - -} - -strong_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/hppa/profil-counter.h b/sysdeps/unix/sysv/linux/hppa/profil-counter.h deleted file mode 100644 index b108be8a36..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/profil-counter.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Machine-dependent SIGPROF signal handler. PA-RISC version - Copyright (C) 1996, 1997, 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. */ - -static void -profil_counter (int signr, siginfo_t *si, struct ucontext *uctx) -{ - unsigned long ip = uctx->uc_mcontext.sc_iaoq[0] & ~0x3; - profil_count ((void *) ip); -} diff --git a/sysdeps/unix/sysv/linux/hppa/socket.S b/sysdeps/unix/sysv/linux/hppa/socket.S deleted file mode 100644 index dfbb721a82..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/socket.S +++ /dev/null @@ -1,10 +0,0 @@ -#include <sysdep.h> - - .globl __socket -PSEUDO(__socket, socket, 3) - -PSEUDO_END(__socket) - -#ifndef NO_WEAK_ALIAS -weak_alias (__socket, socket) -#endif diff --git a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h deleted file mode 100644 index 2e6d10956d..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright (C) 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 _SYS_PROCFS_H -#define _SYS_PROCFS_H 1 - -/* This is somewhat modelled after the file of the same name on SVR4 - systems. It provides a definition of the core file format for ELF - used on Linux. It doesn't have anything to do with the /proc file - system, even though Linux has one. - - Anyway, the whole purpose of this file is for GDB and GDB only. - Don't read too much into it. Don't use it for anything other than - GDB unless you know what you are doing. */ - -#include <features.h> -#include <signal.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/ucontext.h> -#include <sys/user.h> -#include <asm/elf.h> - -__BEGIN_DECLS - -struct elf_siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - }; - -/* Definitions to generate Intel SVR4-like core files. These mostly - have the same names as the SVR4 types with "elf_" tacked on the - front to prevent clashes with Linux definitions, and the typedef - forms have been avoided. This is mostly like the SVR4 structure, - but more Linuxy, with things that Linux does not support and which - GDB doesn't really use excluded. */ - -struct elf_prstatus - { - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ - elf_gregset_t pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -#define ELF_PRARGSZ (80) /* Number of chars for args. */ - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - unsigned long int pr_flag; /* Flags. */ - unsigned int pr_uid; - unsigned 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. */ - }; - - -/* The rest of this file provides the types for emulation of the - Solaris <proc_service.h> interfaces that should be implemented by - users of libthread_db. */ - -/* Addresses. */ -typedef void *psaddr_t; - -/* Register sets. Linux has different names. */ -typedef elf_gregset_t prgregset_t; -typedef elf_fpregset_t prfpregset_t; - -/* We don't have any differences between processes and threads, - therefore have only one PID type. */ -typedef __pid_t lwpid_t; - -/* Process status and info. In the end we do provide typedefs for them. */ -typedef struct elf_prstatus prstatus_t; -typedef struct elf_prpsinfo prpsinfo_t; - -__END_DECLS - -#endif /* sys/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h deleted file mode 100644 index 1431143849..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2001 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. */ - -/* Don't rely on this, the interface is currently messed up and may need to - be broken to be fixed. */ -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <signal.h> - -/* We need the signal context definitions even if they are not used - included in <signal.h>. */ -#include <bits/sigcontext.h> - - -/* Type for general register. */ -typedef unsigned long int greg_t; - -/* Number of general registers. */ -#define NGREG 80 -#define NFPREG 32 - -/* Container for all general registers. */ -typedef struct gregset - { - greg_t g_regs[32]; - greg_t sr_regs[8]; - greg_t cr_regs[24]; - greg_t g_pad[16]; - } gregset_t; - -/* Container for all FPU registers. */ -typedef struct fpregset - { - double fp_dregs[32]; - } fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct sigcontext mcontext_t; - -/* Userlevel context. */ -typedef struct ucontext - { - unsigned long int uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - __sigset_t uc_sigmask; - } ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/unix/sysv/linux/hppa/syscall.S b/sysdeps/unix/sysv/linux/hppa/syscall.S deleted file mode 100644 index b333487c99..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/syscall.S +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 1995, 1996, 1998, 2001 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. */ - -/* HPPA implements syscall() in 'C'; see sysdep.c. */ diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list deleted file mode 100644 index 0f7537c306..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ /dev/null @@ -1,37 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# semaphore and shm system calls -msgctl - msgctl i:iip __msgctl msgctl -msgget - msgget i:ii __msgget msgget -msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd -shmat - shmat i:ipi __shmat shmat -shmctl - shmctl i:iip __shmctl shmctl -shmdt - shmdt i:s __shmdt shmdt -shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop -semtimedop - semtimedop i:ipip semtimedop -semget - semget i:iii __semget semget -semctl - semctl i:iiii __semctl semctl - -# proper socket implementations: -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect_internal __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair - -setrlimit - setrlimit i:ip __setrlimit setrlimit -getrlimit - getrlimit i:ip __getrlimit getrlimit diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/sysdep.c deleted file mode 100644 index 192efbaf75..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 1997, 1998, 2001, 2003 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 <sysdep.h> -#include <errno.h> - -extern int __syscall_error(int err_no); -extern int syscall (int sysnum, int arg0, int arg1, int arg2, - int arg3, int arg4, int arg5); - -/* This routine is jumped to by all the syscall handlers, to stash - an error number into errno. */ -int -__syscall_error (int err_no) -{ - __set_errno (err_no); - return -1; -} - - -/* HPPA implements syscall() in 'C'; the assembler version would - typically be in syscall.S. Also note that we have INLINE_SYSCALL, - INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers. - How often the function is used is unknown. */ -int -syscall (int sysnum, int arg0, int arg1, int arg2, int arg3, int arg4, - int arg5) -{ - /* FIXME: Keep this matching INLINE_SYSCALL for hppa */ - long int __sys_res; - { - register unsigned long int __res asm("r28"); - LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5) - asm volatile (STW_ASM_PIC - " ble 0x100(%%sr2, %%r0) \n" - " copy %1, %%r20 \n" - LDW_ASM_PIC - : "=r" (__res) - : "r" (sysnum) ASM_ARGS_6 - : CALL_CLOB_REGS CLOB_ARGS_6); - __sys_res = __res; - } - if ((unsigned long int) __sys_res >= (unsigned long int) -4095) - { - __set_errno (-__sys_res); - __sys_res = -1; - } - return __sys_res; -} diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h deleted file mode 100644 index 4cfe63c556..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ /dev/null @@ -1,419 +0,0 @@ -/* Assembler macros for PA-RISC. - Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. - Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000. - - 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 <asm/unistd.h> -#include <sysdeps/generic/sysdep.h> -#include <sys/syscall.h> -#include "config.h" - -#ifndef ASM_LINE_SEP -# define ASM_LINE_SEP ; -#endif - -#undef SYS_ify -#define SYS_ify(syscall_name) (__NR_##syscall_name) - -#ifdef PIC -/* WARNING: CANNOT BE USED IN A NOP! */ -# define STW_PIC stw %r19, -32(%sr0, %sp) ASM_LINE_SEP -# define LDW_PIC ldw -32(%sr0, %sp), %r19 ASM_LINE_SEP -# define STW_ASM_PIC " copy %%r19, %%r4\n" -# define LDW_ASM_PIC " copy %%r4, %%r19\n" -# define USING_GR4 "%r4", -#else -# define STW_PIC ASM_LINE_SEP -# define LDW_PIC ASM_LINE_SEP -# define STW_ASM_PIC " \n" -# define LDW_ASM_PIC " \n" -# define USING_GR4 -#endif - -#ifdef __ASSEMBLER__ - -/* Syntactic details of assembler. */ - -#define ALIGNARG(log2) log2 - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#define SYS_ify(syscall_name) __NR_##syscall_name - -/* ELF-like local names start with `.L'. */ -#undef L -#define L(name) .L##name - -/* Linux uses a negative return value to indicate syscall errors, - unlike most Unices, which use the condition codes' carry flag. - - Since version 2.1 the return value of a system call might be - negative even if the call succeeded. E.g., the `lseek' system call - might return a large offset. Therefore we must not anymore test - for < 0, but test for a real error by making sure the value in %eax - is a real error number. Linus said he will make sure the no syscall - returns a value in -1 .. -4095 as a valid result so we can safely - test with -4095. */ - -/* We don't want the label for the error handle to be global when we define - it here. */ -#ifdef PIC -# define SYSCALL_ERROR_LABEL 0f -#else -# define SYSCALL_ERROR_LABEL syscall_error -#endif - -/* Define an entry point visible from C. - - There is currently a bug in gdb which prevents us from specifying - incomplete stabs information. Fake some entries here which specify - the current source file. */ -#define ENTRY(name) \ - .text ASM_LINE_SEP \ - .export C_SYMBOL_NAME(name) ASM_LINE_SEP \ - .type C_SYMBOL_NAME(name),@function ASM_LINE_SEP \ - C_LABEL(name) ASM_LINE_SEP \ - CALL_MCOUNT ASM_LINE_SEP - -#undef END -#define END(name) \ -1: ASM_LINE_SEP \ -.size C_SYMBOL_NAME(name),1b-C_SYMBOL_NAME(name) ASM_LINE_SEP - -/* If compiled for profiling, call `mcount' at the start of each function. */ -/* No, don't bother. gcc will put the call in for us. */ -#define CALL_MCOUNT /* Do nothing. */ - -/* syscall wrappers consist of - #include <sysdep.h> - PSEUDO(...) - ret - PSEUDO_END(...) - - which means - ENTRY(name) - DO_CALL(...) - nop - bv 0(2) - nop -*/ - -#define PSEUDO(name, syscall_name, args) \ - ENTRY (name) \ - DO_CALL(syscall_name, args) ASM_LINE_SEP \ - nop ASM_LINE_SEP - -#define ret \ - /* Return value set by ERRNO code */ ASM_LINE_SEP \ - bv 0(2) ASM_LINE_SEP \ - nop ASM_LINE_SEP - -#undef PSEUDO_END -#define PSEUDO_END(name) \ - END (name) - -/* We don't set the errno on the return from the syscall */ -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - ENTRY (name) \ - DO_CALL_NOERRNO(syscall_name, args) ASM_LINE_SEP \ - nop ASM_LINE_SEP - -#define ret_NOERRNO ret - -#undef PSEUDO_END_NOERRNO -#define PSEUDO_END_NOERRNO(name) \ - END (name) - -/* This has to return the error value */ -#undef PSEUDO_ERRVAL -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - ENTRY(name) \ - DO_CALL_ERRVAL(syscall_name, args) ASM_LINE_SEP \ - nop ASM_LINE_SEP - -#define ret_ERRVAL ret - -#undef PSEUDO_END_ERRVAL -#define PSEUDO_END_ERRVAL(name) \ - END(name) - -#undef JUMPTARGET -#define JUMPTARGET(name) name -#define SYSCALL_PIC_SETUP /* Nothing. */ - - -/* All the syscall assembly macros rely on finding the approriate - SYSCALL_ERROR_LABEL or rather HANDLER. */ - -/* int * __errno_location(void) so you have to store your value - into the return address! */ -#define DEFAULT_SYSCALL_ERROR_HANDLER \ - .import __errno_location,code ASM_LINE_SEP \ - /* branch to errno handler */ ASM_LINE_SEP \ - bl __errno_location,%rp ASM_LINE_SEP - -/* Here are the myriad of configuration options that the above can - work for... what we've done is provide the framework for future - changes if required to each section */ - -#ifdef PIC -# if RTLD_PRIVATE_ERRNO -# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER -# else /* !RTLD_PRIVATE_ERRNO */ -# if defined _LIBC_REENTRANT -# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER -# else /* !_LIBC_REENTRANT */ -# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER -# endif /* _LIBC_REENTRANT */ -# endif /* RTLD_PRIVATE_ERRNO */ -#else -# ifndef _LIBC_REENTRANT -# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER -# else -# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER -# endif -#endif - - -/* Linux takes system call arguments in registers: - syscall number gr20 - arg 1 gr26 - arg 2 gr25 - arg 3 gr24 - arg 4 gr23 - arg 5 gr22 - arg 6 gr21 - - The compiler calls us by the C convention: - syscall number in the DO_CALL macro - arg 1 gr26 - arg 2 gr25 - arg 3 gr24 - arg 4 gr23 - arg 5 -52(gr30) - arg 6 -56(gr30) - - gr22 and gr21 are caller-saves, so we can just load the arguments - there and generally be happy. */ - -/* the cmpb...no_error code below inside DO_CALL - * is intended to mimic the if (__sys_res...) - * code inside INLINE_SYSCALL - */ - -#undef DO_CALL -#define DO_CALL(syscall_name, args) \ - DOARGS_##args ASM_LINE_SEP \ - STW_PIC ASM_LINE_SEP \ - /* Do syscall, delay loads # */ ASM_LINE_SEP \ - ble 0x100(%sr2,%r0) ASM_LINE_SEP \ - ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ - ldi -0x1000,%r1 ASM_LINE_SEP \ - cmpb,>>=,n %r1,%ret0,0f ASM_LINE_SEP \ - /* save rp or we get lost */ ASM_LINE_SEP \ - stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \ - /* Restore r19 from frame */ ASM_LINE_SEP \ - LDW_PIC ASM_LINE_SEP \ - stw %ret0, -24(%sr0,%sp) ASM_LINE_SEP \ - SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ - /* create frame */ ASM_LINE_SEP \ - ldo 64(%sp), %sp ASM_LINE_SEP \ - ldo -64(%sp), %sp ASM_LINE_SEP \ - /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ - /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ - ldw -24(%sr0,%sp), %r26 ASM_LINE_SEP \ - sub %r0, %r26, %r26 ASM_LINE_SEP \ - /* Store into errno location */ ASM_LINE_SEP \ - stw %r26, 0(%sr0,%ret0) ASM_LINE_SEP \ - /* return -1 as error */ ASM_LINE_SEP \ - ldo -1(%r0), %ret0 ASM_LINE_SEP \ - ldw -20(%sr0,%sp), %rp ASM_LINE_SEP \ -0: ASM_LINE_SEP \ - UNDOARGS_##args ASM_LINE_SEP - -/* We do nothing with the return, except hand it back to someone else */ -#undef DO_CALL_NOERRNO -#define DO_CALL_NOERRNO(syscall_name, args) \ - DOARGS_##args \ - /* No need to store r19 */ ASM_LINE_SEP \ - ble 0x100(%sr2,%r0) ASM_LINE_SEP \ - ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ - /* Caller will restore r19 */ ASM_LINE_SEP \ - UNDOARGS_##args - -/* Here, we return the ERRVAL in assembly, note we don't call the - error handler function, but we do 'negate' the return _IF_ - it's an error. Not sure if this is the right semantic. */ - -#undef DO_CALL_ERRVAL -#define DO_CALL_ERRVAL(syscall_name, args) \ - DOARGS_##args ASM_LINE_SEP \ - /* No need to store r19 */ ASM_LINE_SEP \ - ble 0x100(%sr2,%r0) ASM_LINE_SEP \ - ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ - /* Caller will restore r19 */ ASM_LINE_SEP \ - ldi -0x1000,%r1 ASM_LINE_SEP \ - cmpb,>>=,n %r1,%ret0,0f ASM_LINE_SEP \ - sub %r0, %ret0, %ret0 ASM_LINE_SEP \ -0: ASM_LINE_SEP \ - UNDOARGS_##args ASM_LINE_SEP - -#define DOARGS_0 /* nothing */ -#define DOARGS_1 /* nothing */ -#define DOARGS_2 /* nothing */ -#define DOARGS_3 /* nothing */ -#define DOARGS_4 /* nothing */ -#define DOARGS_5 ldw -52(%r30), %r22 ASM_LINE_SEP -#define DOARGS_6 ldw -52(%r30), %r22 ASM_LINE_SEP \ - ldw -56(%r30), %r21 ASM_LINE_SEP - - -#define UNDOARGS_0 /* nothing */ -#define UNDOARGS_1 /* nothing */ -#define UNDOARGS_2 /* nothing */ -#define UNDOARGS_3 /* nothing */ -#define UNDOARGS_4 /* nothing */ -#define UNDOARGS_5 /* nothing */ -#define UNDOARGS_6 /* nothing */ - -#else - -/* GCC has to be warned that a syscall may clobber all the ABI - registers listed as "caller-saves", see page 8, Table 2 - in section 2.2.6 of the PA-RISC RUN-TIME architecture - document. However! r28 is the result and will conflict with - the clobber list so it is left out. Also the input arguments - registers r20 -> r26 will conflict with the list so they - are treated specially. Although r19 is clobbered by the syscall - we cannot say this because it would violate ABI, thus we say - r4 is clobbered and use that register to save/restore r19 - across the syscall. */ - -#define CALL_CLOB_REGS "%r1", "%r2", USING_GR4 \ - "%r20", "%r29", "%r31" - -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) ({ \ - long __sys_res; \ - { \ - register unsigned long __res asm("r28"); \ - LOAD_ARGS_##nr(args) \ - /* FIXME: HACK stw/ldw r19 around syscall */ \ - asm volatile( \ - STW_ASM_PIC \ - " ble 0x100(%%sr2, %%r0)\n" \ - " ldi %1, %%r20\n" \ - LDW_ASM_PIC \ - : "=r" (__res) \ - : "i" (SYS_ify(name)) ASM_ARGS_##nr \ - : CALL_CLOB_REGS CLOB_ARGS_##nr \ - ); \ - __sys_res = (long)__res; \ - } \ - if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){ \ - __set_errno(-__sys_res); \ - __sys_res = -1; \ - } \ - __sys_res; \ -}) - -/* INTERNAL_SYSCALL_DECL - Allows us to setup some function static - value to use within the context of the syscall - INTERNAL_SYSCALL_ERROR_P - Returns 0 if it wasn't an error, 1 otherwise - You are allowed to use the syscall result (val) and the DECL error variable - to determine what went wrong. - INTERLAL_SYSCALL_ERRNO - Munges the val/err pair into the error number. - In our case we just flip the sign. */ - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) do { } while (0) - -/* Equivalent to (val < 0)&&(val > -4095) which is what we want */ -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long)val >= (unsigned long)-4095) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) - -/* Similar to INLINE_SYSCALL but we don't set errno */ -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ -({ \ - long __sys_res; \ - { \ - register unsigned long __res asm("r28"); \ - LOAD_ARGS_##nr(args) \ - /* FIXME: HACK stw/ldw r19 around syscall */ \ - asm volatile( \ - STW_ASM_PIC \ - " ble 0x100(%%sr2, %%r0)\n" \ - " ldi %1, %%r20\n" \ - LDW_ASM_PIC \ - : "=r" (__res) \ - : "i" (SYS_ify(name)) ASM_ARGS_##nr \ - : CALL_CLOB_REGS CLOB_ARGS_##nr \ - ); \ - __sys_res = (long)__res; \ - } \ - __sys_res; \ - }) - -#define LOAD_ARGS_0() -#define LOAD_ARGS_1(r26) \ - register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \ - LOAD_ARGS_0() -#define LOAD_ARGS_2(r26,r25) \ - register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \ - LOAD_ARGS_1(r26) -#define LOAD_ARGS_3(r26,r25,r24) \ - register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \ - LOAD_ARGS_2(r26,r25) -#define LOAD_ARGS_4(r26,r25,r24,r23) \ - register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \ - LOAD_ARGS_3(r26,r25,r24) -#define LOAD_ARGS_5(r26,r25,r24,r23,r22) \ - register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \ - LOAD_ARGS_4(r26,r25,r24,r23) -#define LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \ - register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \ - LOAD_ARGS_5(r26,r25,r24,r23,r22) - -/* Even with zero args we use r20 for the syscall number */ -#define ASM_ARGS_0 -#define ASM_ARGS_1 ASM_ARGS_0, "r" (__r26) -#define ASM_ARGS_2 ASM_ARGS_1, "r" (__r25) -#define ASM_ARGS_3 ASM_ARGS_2, "r" (__r24) -#define ASM_ARGS_4 ASM_ARGS_3, "r" (__r23) -#define ASM_ARGS_5 ASM_ARGS_4, "r" (__r22) -#define ASM_ARGS_6 ASM_ARGS_5, "r" (__r21) - -/* The registers not listed as inputs but clobbered */ -#define CLOB_ARGS_6 -#define CLOB_ARGS_5 CLOB_ARGS_6, "%r21" -#define CLOB_ARGS_4 CLOB_ARGS_5, "%r22" -#define CLOB_ARGS_3 CLOB_ARGS_4, "%r23" -#define CLOB_ARGS_2 CLOB_ARGS_3, "%r24" -#define CLOB_ARGS_1 CLOB_ARGS_2, "%r25" -#define CLOB_ARGS_0 CLOB_ARGS_1, "%r26" - -#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/hppa/umount.c b/sysdeps/unix/sysv/linux/hppa/umount.c deleted file mode 100644 index e7c5690890..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/umount.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines <dhd@debian.org>, 2000. - - 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. */ - -/* Since we don't have an oldumount system call, do what the kernel - does down here. */ - -extern long int __umount2 (const char *name, int flags); - -long int -__umount (const char *name) -{ - return __umount2 (name, 0); -} - -weak_alias (__umount, umount); diff --git a/sysdeps/unix/sysv/linux/i386/fchownat.c b/sysdeps/unix/sysv/linux/i386/fchownat.c index b2bac1913f..e5306db6ee 100644 --- a/sysdeps/unix/sysv/linux/i386/fchownat.c +++ b/sysdeps/unix/sysv/linux/i386/fchownat.c @@ -168,11 +168,11 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag) #endif if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0)) - { - fail: - __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); - result = -1; - } + goto fail; return result; + + fail: + __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); + return -1; } diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 837a1c14fb..9f3f3965f4 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -21,10 +21,6 @@ /* This file must not contain any C code. At least it must be protected to allow using the file also in assembler files. */ -#if defined __mips__ -# include <sgidefs.h> -#endif - #ifndef __LINUX_KERNEL_VERSION /* We assume the worst; all kernels should be supported. */ # define __LINUX_KERNEL_VERSION 0 @@ -133,7 +129,7 @@ /* Linux 2.3.39 introduced 32bit UID/GIDs. Some platforms had 32 bit type all along. */ -#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__ +#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ # define __ASSUME_32BITUIDS 1 #endif @@ -151,11 +147,6 @@ # define __ASSUME_IPC64 1 #endif -/* MIPS platforms had IPC64 all along. */ -#if defined __mips__ -# define __ASSUME_IPC64 1 -#endif - /* We can use the LDTs for threading with Linux 2.3.99 and newer. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_LDT_WORKS 1 @@ -292,15 +283,16 @@ # define __ASSUME_TIMEVAL64 1 #endif -#if defined __mips__ && _MIPS_SIM == _ABIN32 -# define __ASSUME_FCNTL64 1 -#endif - /* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize their availability with one define. The changes were made first for i386 and the have to be done separately for the other archs. - For i386 we pick 2.5.50 as the first version with support. */ -#if __LINUX_KERNEL_VERSION >= 132402 && defined __i386__ + For i386 we pick 2.5.50 as the first version with support. + For ia64, s390*, PPC, x86-64, and SH we pick 2.5.64 as the first + version with support. */ +#if ((__LINUX_KERNEL_VERSION >= 132402 && defined __i386__) \ + || (__LINUX_KERNEL_VERSION >= 132416 \ + && (defined __ia64__ || defined __s390__ \ + || defined __powerpc__ || defined __x86_64__ || defined __sh__))) # define __ASSUME_CLONE_THREAD_FLAGS 1 #endif @@ -324,17 +316,6 @@ # define __ASSUME_POSIX_CPU_TIMERS 1 #endif -/* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize - their availability with one define. The changes were made first - for i386 and the have to be done separately for the other archs. - For ia64, s390*, PPC, x86-64 we pick 2.5.64 as the first version - with support. */ -#if __LINUX_KERNEL_VERSION >= 132416 \ - && (defined __ia64__ || defined __s390__ || defined __powerpc__ \ - || defined __x86_64__ || defined __sh__) -# define __ASSUME_CLONE_THREAD_FLAGS 1 -#endif - /* With kernel 2.4.17 we always have netlink support. */ #if __LINUX_KERNEL_VERSION >= (132096+17) # define __ASSUME_NETLINK_SUPPORT 1 diff --git a/sysdeps/unix/sysv/linux/linkat.c b/sysdeps/unix/sysv/linux/linkat.c index 5485b3f61c..cfd0e18223 100644 --- a/sysdeps/unix/sysv/linux/linkat.c +++ b/sysdeps/unix/sysv/linux/linkat.c @@ -28,11 +28,12 @@ /* Make a link to FROM named TO but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ int -linkat (fromfd, from, tofd, to) +linkat (fromfd, from, tofd, to, flags) int fromfd; const char *from; int tofd; const char *to; + int flags; { int result; @@ -41,7 +42,7 @@ linkat (fromfd, from, tofd, to) if (__have_atfcts >= 0) # endif { - result = INLINE_SYSCALL (linkat, 4, fromfd, from, tofd, to); + result = INLINE_SYSCALL (linkat, 5, fromfd, from, tofd, to, flags); # ifndef __ASSUME_ATFCTS if (result == -1 && errno == ENOSYS) __have_atfcts = -1; @@ -52,6 +53,13 @@ linkat (fromfd, from, tofd, to) #endif #ifndef __ASSUME_ATFCTS + /* Without kernel support we cannot handle AT_SYMLINK_FOLLOW. */ + if (flags != 0) + { + __set_errno (EINVAL); + return -1; + } + static const char procfd[] = "/proc/self/fd/%d/%s"; char *buffrom = NULL; diff --git a/sysdeps/unix/sysv/linux/m68k/Makefile b/sysdeps/unix/sysv/linux/m68k/Makefile deleted file mode 100644 index 6bb4f6b816..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Linux/m68k uses Motorola asm syntax and the ELF format. - -m68k-syntax-flag = -DMOTOROLA_SYNTAX - -ifeq ($(subdir),misc) -sysdep_routines += mremap -sysdep_headers += sys/reg.h -endif - -ifeq ($(subdir),elf) -sysdep-others += lddlibc4 -install-bin += lddlibc4 -endif - -ifeq ($(subdir),resource) -sysdep_routines += oldgetrlimit64 -endif diff --git a/sysdeps/unix/sysv/linux/m68k/Versions b/sysdeps/unix/sysv/linux/m68k/Versions deleted file mode 100644 index 0799bf310e..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/Versions +++ /dev/null @@ -1,32 +0,0 @@ -libc { - GLIBC_2.0 { - # Exception handling support functions from libgcc - __register_frame; __register_frame_table; __deregister_frame; - __frame_state_for; __register_frame_info_table; - - # c* - cacheflush; - } - GLIBC_2.2 { - # functions used in other libraries - __xstat64; __fxstat64; __lxstat64; - - # a* - alphasort64; - - # g* - glob64; - - # New rlimit interface - getrlimit; setrlimit; getrlimit64; - - # r* - readdir64; readdir64_r; - - # s* - scandir64; - - # v* - versionsort64; - } -} diff --git a/sysdeps/unix/sysv/linux/m68k/alphasort64.c b/sysdeps/unix/sysv/linux/m68k/alphasort64.c deleted file mode 100644 index 0b5ae47d2f..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/alphasort64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/alphasort64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/bits/a.out.h b/sysdeps/unix/sysv/linux/m68k/bits/a.out.h deleted file mode 100644 index 0fb52c3815..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/bits/a.out.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef __A_OUT_GNU_H__ -# error "Never use <bits/a.out.h> directly; include <a.out.h> instead." -#endif diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h deleted file mode 100644 index 90c0a481e4..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h +++ /dev/null @@ -1,188 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 2000, 2004 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 _FCNTL_H -# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." -#endif - - -#include <sys/types.h> - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define O_FSYNC O_SYNC -#define O_ASYNC 020000 - -#ifdef __USE_GNU -# define O_DIRECTORY 040000 /* Must be a directory. */ -# define O_NOFOLLOW 0100000 /* Do not follow links. */ -# define O_DIRECT 0200000 /* Direct disk access. */ -# define O_NOATIME 01000000 /* Do not set atime. */ -#endif - -/* For now Linux has synchronisity options for data and read operations. - We define the symbols here but let them do the same as O_SYNC since - this is a superset. */ -#if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ -# define O_RSYNC O_SYNC /* Synchronize read operations. */ -#endif - -#ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 0400000 -#endif - -/* Values for the second argument to `fcntl'. */ -#define F_DUPFD 0 /* Duplicate file descriptor. */ -#define F_GETFD 1 /* Get file descriptor flags. */ -#define F_SETFD 2 /* Set file descriptor flags. */ -#define F_GETFL 3 /* Get file status flags. */ -#define F_SETFL 4 /* Set file status flags. */ -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 5 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ -#endif -#define F_GETLK64 12 /* Get record locking info. */ -#define F_SETLK64 13 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 14 /* Set record locking info (blocking). */ - -#if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ -# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ -#endif - -#ifdef __USE_GNU -# define F_SETSIG 10 /* Set number of signal to be sent. */ -# define F_GETSIG 11 /* Get number of signal to be sent. */ -#endif - -#ifdef __USE_GNU -# define F_SETLEASE 1024 /* Set a lease. */ -# define F_GETLEASE 1025 /* Enquire what lease is active. */ -# define F_NOTIFY 1026 /* Request notfications on a directory. */ -#endif - -/* For F_[GET|SET]FL. */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ -#define F_RDLCK 0 /* Read lock. */ -#define F_WRLCK 1 /* Write lock. */ -#define F_UNLCK 2 /* Remove lock. */ - -/* For old implementation of bsd flock(). */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -#ifdef __USE_BSD -/* Operations for bsd flock(), also used by the kernel implementation. */ -# define LOCK_SH 1 /* shared lock */ -# define LOCK_EX 2 /* exclusive lock */ -# define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -# define LOCK_UN 8 /* remove lock */ -#endif - -#ifdef __USE_GNU -# define LOCK_MAND 32 /* This is a mandatory flock: */ -# define LOCK_READ 64 /* ... which allows concurrent read operations. */ -# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ -# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ -#endif - -#ifdef __USE_GNU -/* Types of directory notifications that may be requested with F_NOTIFY. */ -# define DN_ACCESS 0x00000001 /* File accessed. */ -# define DN_MODIFY 0x00000002 /* File modified. */ -# define DN_CREATE 0x00000004 /* File created. */ -# define DN_DELETE 0x00000008 /* File removed. */ -# define DN_RENAME 0x00000010 /* File renamed. */ -# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ -# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ -#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 - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -# define FAPPEND O_APPEND -# define FFSYNC O_FSYNC -# define FASYNC O_ASYNC -# define FNONBLOCK O_NONBLOCK -# define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -/* Advise to `posix_fadvise'. */ -#ifdef __USE_XOPEN2K -# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ -# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ -#endif - -__BEGIN_DECLS - -/* Provide kernel hint to read ahead. */ -extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) - __THROW; - -__END_DECLS diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h deleted file mode 100644 index fbec1a03f8..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/bits/mman.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux/m68k version. - Copyright (C) 1997, 2000, 2003, 2005 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 _SYS_MMAN_H -# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." -#endif - -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. */ - - -/* Protections are chosen from these bits, OR'd together. The - implementation does not necessarily support PROT_EXEC or PROT_WRITE - without PROT_READ. The only guarantees are that no writing will be - allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ - -#define PROT_READ 0x1 /* Page can be read. */ -#define PROT_WRITE 0x2 /* Page can be written. */ -#define PROT_EXEC 0x4 /* Page can be executed. */ -#define PROT_NONE 0x0 /* Page can not be accessed. */ -#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of - growsdown vma (mprotect only). */ -#define PROT_GROWSUP 0x02000000 /* Extend change to start of - growsup vma (mprotect only). */ - -/* Sharing types (must choose one and only one of these). */ -#define MAP_SHARED 0x01 /* Share changes. */ -#define MAP_PRIVATE 0x02 /* Changes are private. */ -#ifdef __USE_MISC -# define MAP_TYPE 0x0f /* Mask for type of mapping. */ -#endif - -/* Other flags. */ -#define MAP_FIXED 0x10 /* Interpret addr exactly. */ -#ifdef __USE_MISC -# define MAP_FILE 0 -# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ -# define MAP_ANON MAP_ANONYMOUS -#endif - -/* These are Linux-specific. */ -#ifdef __USE_MISC -# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ -# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ -# define MAP_LOCKED 0x02000 /* Lock the mapping. */ -# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ -# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ -# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ -#endif - -/* Flags to `msync'. */ -#define MS_ASYNC 1 /* Sync memory asynchronously. */ -#define MS_SYNC 4 /* Synchronous memory sync. */ -#define MS_INVALIDATE 2 /* Invalidate the caches. */ - -/* Flags for `mlockall'. */ -#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ -#define MCL_FUTURE 2 /* Lock all additions to address - space. */ - -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif - -/* Advice to `madvise'. */ -#ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ -#endif - -/* The POSIX people had to invent similar names for the same things. */ -#ifdef __USE_XOPEN2K -# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ -#endif diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h deleted file mode 100644 index f7a7393154..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1997, 2001 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 _SYS_POLL_H -# error "Never use <bits/poll.h> directly; include <sys/poll.h> 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. */ - -#ifdef __USE_XOPEN -/* 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 - -/* 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. */ diff --git a/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/sysdeps/unix/sysv/linux/m68k/bits/stat.h deleted file mode 100644 index dc06b13e2f..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/bits/stat.h +++ /dev/null @@ -1,164 +0,0 @@ -/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002 - 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 _SYS_STAT_H -# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." -#endif - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ - - -struct stat - { - __dev_t st_dev; /* Device. */ - unsigned short int __pad1; -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -#else - __ino_t __st_ino; /* 32bit 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_MISC - /* 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 <sys/stat.h> 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 -#ifndef __USE_FILE_OFFSET64 - unsigned long int __unused4; - unsigned long int __unused5; -#else - __ino64_t st_ino; /* File serial number. */ -#endif - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - unsigned short int __pad1; - - __ino_t __st_ino; /* 32bit 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_MISC - /* 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 <sys/stat.h> 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 - __ino64_t st_ino; /* File serial number. */ - }; -#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 - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* POSIX.1b objects. Note that these macros always evaluate to zero. But - they do it by enforcing the correct use of the macros. */ -#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ diff --git a/sysdeps/unix/sysv/linux/m68k/chown.c b/sysdeps/unix/sysv/linux/m68k/chown.c deleted file mode 100644 index e7193dc23b..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/chown.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 1998,2000,2002,2003,2006 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 <errno.h> -#include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <linux/posix_types.h> -#include <kernel-features.h> - -#ifdef __NR_chown32 -# if __ASSUME_32BITUIDS == 0 -/* This variable is shared with all files that need to check for 32bit - uids. */ -extern int __libc_missing_32bit_uids; -# endif -#endif /* __NR_chown32 */ - -int -__chown (const char *file, uid_t owner, gid_t group) -{ -#if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); -#else -# ifdef __NR_chown32 - if (__libc_missing_32bit_uids <= 0) - { - int result; - int saved_errno = errno; - - result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); - if (result == 0 || errno != ENOSYS) - return result; - - __set_errno (saved_errno); - __libc_missing_32bit_uids = 1; - } -# endif /* __NR_chown32 */ - - if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U)) - || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U))) - { - __set_errno (EINVAL); - return -1; - } - - return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); -#endif -} -libc_hidden_def (__chown) -weak_alias (__chown, chown) diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S deleted file mode 100644 index 6baf723d9b..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 1996,97,98,2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de) - - 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. */ - -/* clone is even more special than fork as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - - .text -ENTRY (__clone) - - /* Sanity check arguments. */ - movel #-EINVAL, %d0 - movel 4(%sp), %a0 /* no NULL function pointers */ - tstl %a0 - jeq SYSCALL_ERROR_LABEL - movel 8(%sp), %a1 /* no NULL stack pointers */ - tstl %a1 - jeq SYSCALL_ERROR_LABEL - - /* Allocate space and copy the argument onto the new stack. */ - movel 16(%sp), -(%a1) - - /* Do the system call */ - exg %d2, %a1 /* save %d2 and get stack pointer */ - movel 12(%sp), %d1 /* get flags */ - movel #SYS_ify (clone), %d0 - trap #0 - exg %d2, %a1 /* restore %d2 */ - - tstl %d0 - jmi SYSCALL_ERROR_LABEL - jeq thread_start - - rts - -thread_start: - subl %fp, %fp /* terminate the stack frame */ - jsr (%a0) - movel %d0, %d1 - movel #SYS_ify (exit), %d0 - trap #0 - -PSEUDO_END (__clone) - -weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/m68k/dl-librecon.h b/sysdeps/unix/sysv/linux/m68k/dl-librecon.h deleted file mode 100644 index dbb4e75712..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/dl-librecon.h +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/dl-librecon.h> diff --git a/sysdeps/unix/sysv/linux/m68k/fchown.c b/sysdeps/unix/sysv/linux/m68k/fchown.c deleted file mode 100644 index 3a69ecc9e7..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/fchown.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fchown.c> diff --git a/sysdeps/unix/sysv/linux/m68k/fchownat.c b/sysdeps/unix/sysv/linux/m68k/fchownat.c deleted file mode 100644 index 6cc093222d..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/fchownat.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (C) 2005, 2006 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 <errno.h> -#include <fcntl.h> -#include <stdio.h> -#include <unistd.h> -#include <string.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <linux/posix_types.h> -#include <kernel-features.h> - -#ifdef __NR_chown32 -# if __ASSUME_32BITUIDS == 0 -/* This variable is shared with all files that need to check for 32bit - uids. */ -extern int __libc_missing_32bit_uids; -# endif -#endif /* __NR_chown32 */ - -int -fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag) -{ - if (flag & ~AT_SYMLINK_NOFOLLOW) - { - __set_errno (EINVAL); - return -1; - } - - char *buf = NULL; - - if (fd != AT_FDCWD && file[0] != '/') - { - size_t filelen = strlen (file); - static const char procfd[] = "/proc/self/fd/%d/%s"; - /* Buffer for the path name we are going to use. It consists of - - the string /proc/self/fd/ - - the file descriptor number - - the file name provided. - The final NUL is included in the sizeof. A bit of overhead - due to the format elements compensates for possible negative - numbers. */ - size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; - buf = alloca (buflen); - - __snprintf (buf, buflen, procfd, fd, file); - file = buf; - } - - int result; - INTERNAL_SYSCALL_DECL (err); - -#if __ASSUME_32BITUIDS > 0 - if (flag & AT_SYMLINK_NOFOLLOW) - result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner, - group); - else - result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner, - group); -#else -# ifdef __NR_chown32 - if (__libc_missing_32bit_uids <= 0) - { - if (flag & AT_SYMLINK_NOFOLLOW) - result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), - owner, group); - else - result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner, - group); - - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return result; - if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS) - goto fail; - - __libc_missing_32bit_uids = 1; - } -# endif /* __NR_chown32 */ - - if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U)) - || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U))) - { - __set_errno (EINVAL); - return -1; - } - - if (flag & AT_SYMLINK_NOFOLLOW) - result = INTERNAL_SYSCALL (lchown, err, 3, CHECK_STRING (file), owner, - group); - else - result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner, - group); -#endif - - if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0)) - { - fail: - __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); - result = -1; - } - - return result; -} diff --git a/sysdeps/unix/sysv/linux/m68k/fcntl.c b/sysdeps/unix/sysv/linux/m68k/fcntl.c deleted file mode 100644 index ea951bc4f9..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/fcntl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/sysdeps/unix/sysv/linux/m68k/fxstat.c b/sysdeps/unix/sysv/linux/m68k/fxstat.c deleted file mode 100644 index 4f219f0b9d..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/fxstat.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/sysdeps/unix/sysv/linux/m68k/fxstatat.c b/sysdeps/unix/sysv/linux/m68k/fxstatat.c deleted file mode 100644 index 0f8b3135d8..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/fxstatat.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fxstatat.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getdents64.c b/sysdeps/unix/sysv/linux/m68k/getdents64.c deleted file mode 100644 index 0c75fb5a06..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getdents64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getegid.c b/sysdeps/unix/sysv/linux/m68k/getegid.c deleted file mode 100644 index 37b4b4a530..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getegid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getegid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/geteuid.c b/sysdeps/unix/sysv/linux/m68k/geteuid.c deleted file mode 100644 index ebcb555b5e..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/geteuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/geteuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getgid.c b/sysdeps/unix/sysv/linux/m68k/getgid.c deleted file mode 100644 index 0a4d6061f0..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getgid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getgroups.c b/sysdeps/unix/sysv/linux/m68k/getgroups.c deleted file mode 100644 index 102ea24e14..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getgroups.c +++ /dev/null @@ -1,2 +0,0 @@ -/* We also have to rewrite the kernel gid_t to the user land type. */ -#include <sysdeps/unix/sysv/linux/i386/getgroups.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getmsg.c b/sysdeps/unix/sysv/linux/m68k/getmsg.c deleted file mode 100644 index 3a1fa08525..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getpagesize.c b/sysdeps/unix/sysv/linux/m68k/getpagesize.c deleted file mode 100644 index f7ffdc5185..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getpagesize.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>. - - 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 <unistd.h> -#include <sys/param.h> -#include <errno.h> - -#include <ldsodefs.h> -#include <sysdep.h> -#include <sys/syscall.h> - -/* Return the system page size. */ -int -__getpagesize () -{ -#ifdef __NR_getpagesize - int result; -#endif - - if (GLRO(dl_pagesize) != 0) - return GLRO(dl_pagesize); - -#ifdef __NR_getpagesize - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL (getpagesize, err, 0); - /* The only possible error is ENOSYS. */ - if (!INTERNAL_SYSCALL_ERROR_P (result, err)) - return result; -#endif - - return 4096; -} -libc_hidden_def (__getpagesize) -weak_alias (__getpagesize, getpagesize) diff --git a/sysdeps/unix/sysv/linux/m68k/getresgid.c b/sysdeps/unix/sysv/linux/m68k/getresgid.c deleted file mode 100644 index b703a414cc..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getresgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getresgid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getresuid.c b/sysdeps/unix/sysv/linux/m68k/getresuid.c deleted file mode 100644 index 0b14cefe34..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getresuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getresuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getrlimit.c b/sysdeps/unix/sysv/linux/m68k/getrlimit.c deleted file mode 100644 index fc06dbd641..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getrlimit64.c b/sysdeps/unix/sysv/linux/m68k/getrlimit64.c deleted file mode 100644 index fef018f471..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getsysstats.c b/sysdeps/unix/sysv/linux/m68k/getsysstats.c deleted file mode 100644 index 23207e9bcb..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getsysstats.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Determine various system internal values, Linux/m68k version. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de> - - 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. */ - - -/* We need to define a special parser for /proc/cpuinfo. */ -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ - do \ - { \ - (RESULT) = 0; \ - /* Read all lines and count the lines starting with the string \ - "CPU:". We don't have to fear extremely long lines since \ - the kernel will not generate them. 8192 bytes are really \ - enough. */ \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ - if (strncmp (BUFFER, "CPU:", 4) == 0) \ - ++(RESULT); \ - } \ - while (0) - -#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/sysdeps/unix/sysv/linux/m68k/getuid.c b/sysdeps/unix/sysv/linux/m68k/getuid.c deleted file mode 100644 index d682c79a49..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/glob64.c b/sysdeps/unix/sysv/linux/m68k/glob64.c deleted file mode 100644 index 82a9a296a7..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/glob64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/glob64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/lchown.c b/sysdeps/unix/sysv/linux/m68k/lchown.c deleted file mode 100644 index c89de99ba2..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/lchown.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lchown.c> diff --git a/sysdeps/unix/sysv/linux/m68k/ldconfig.h b/sysdeps/unix/sysv/linux/m68k/ldconfig.h deleted file mode 100644 index 953f192bcd..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/ldconfig.h +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/ldconfig.h> diff --git a/sysdeps/unix/sysv/linux/m68k/lockf64.c b/sysdeps/unix/sysv/linux/m68k/lockf64.c deleted file mode 100644 index a88f5a784a..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/lockf64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/lxstat.c b/sysdeps/unix/sysv/linux/m68k/lxstat.c deleted file mode 100644 index 2371cd9719..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/lxstat.c +++ /dev/null @@ -1,2 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lxstat.c> - diff --git a/sysdeps/unix/sysv/linux/m68k/mmap.S b/sysdeps/unix/sysv/linux/m68k/mmap.S deleted file mode 100644 index 086212a42b..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/mmap.S +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1996, 1997, 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 <sysdep.h> - - .text -ENTRY (__mmap) - - move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */ - - lea 4(%sp), %a0 /* Address of args is 1st arg. */ - move.l %a0, %d1 - - /* Do the system call trap. */ - trap #0 - - /* Kludge: negative numbers are among the legal return values. - If %d0 is between -4096 and 0 then there was an error. */ - cmp.l #-4096, %d0 - jhi SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. Copy it to %a0 because - mmap is declared to return a pointer. */ - move.l %d0, %a0 - rts -PSEUDO_END (__mmap) - -weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/m68k/mremap.S b/sysdeps/unix/sysv/linux/m68k/mremap.S deleted file mode 100644 index 68d961b553..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/mremap.S +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1996 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 <sysdep.h> - -/* The mremap system call is special because it needs to return - its value in register %a0. */ - - .text -PSEUDO (__mremap, mremap, 4) - move.l %d0, %a0 - rts -PSEUDO_END (__mremap) -weak_alias (__mremap, mremap) diff --git a/sysdeps/unix/sysv/linux/m68k/msgctl.c b/sysdeps/unix/sysv/linux/m68k/msgctl.c deleted file mode 100644 index 9f9b8431a3..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/msgctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/msgctl.c> diff --git a/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c deleted file mode 100644 index 4c27e957bf..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/putmsg.c b/sysdeps/unix/sysv/linux/m68k/putmsg.c deleted file mode 100644 index ebc1680ca7..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/putmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64.c b/sysdeps/unix/sysv/linux/m68k/readdir64.c deleted file mode 100644 index 2ea26dd409..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/readdir64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c b/sysdeps/unix/sysv/linux/m68k/readdir64_r.c deleted file mode 100644 index 9f54f897e3..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c> diff --git a/sysdeps/unix/sysv/linux/m68k/register-dump.h b/sysdeps/unix/sysv/linux/m68k/register-dump.h deleted file mode 100644 index a7ac3ca01c..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/register-dump.h +++ /dev/null @@ -1,214 +0,0 @@ -/* Dump registers. - Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <stddef.h> -#include <sys/uio.h> -#include <stdio-common/_itoa.h> - -/* We will print the register dump in this format: - - D0: XXXXXXXX D1: XXXXXXXX D2: XXXXXXXX D3: XXXXXXXX - D4: XXXXXXXX D5: XXXXXXXX D6: XXXXXXXX D7: XXXXXXXX - A0: XXXXXXXX A1: XXXXXXXX A2: XXXXXXXX A3: XXXXXXXX - A4: XXXXXXXX A5: XXXXXXXX A6: XXXXXXXX A7: XXXXXXXX - PC: XXXXXXXX SR: XXXX - - OldMask: XXXXXXXX Vector: XXXX - - FP0: XXXXXXXXXXXXXXXXXXXXXXXX FP1: XXXXXXXXXXXXXXXXXXXXXXXX - FP2: XXXXXXXXXXXXXXXXXXXXXXXX FP3: XXXXXXXXXXXXXXXXXXXXXXXX - FP4: XXXXXXXXXXXXXXXXXXXXXXXX FP5: XXXXXXXXXXXXXXXXXXXXXXXX - FP6: XXXXXXXXXXXXXXXXXXXXXXXX FP7: XXXXXXXXXXXXXXXXXXXXXXXX - FPCR: XXXXXXXX FPSR: XXXXXXXX FPIAR: XXXXXXXX - -*/ - -/* Linux saves only the call-clobbered registers in the sigcontext. We - need to use a trampoline that saves the rest so that the C code can - access them. We use the sc_fpstate field, since the handler is not - supposed to return anyway, thus it doesn't matter that it's clobbered. */ - -/* static */ void catch_segfault (int, int, struct sigcontext *); - -/* Dummy function so that we can use asm with arguments. */ -static void __attribute_used__ -__dummy__ (void) -{ - asm ("\n\ -catch_segfault:\n\ - move.l 12(%%sp),%%a0\n\ - lea %c0(%%a0),%%a0\n\ - /* Clear the first 4 bytes to make it a null fp state, just\n\ - in case the handler does return. */\n\ - clr.l (%%a0)+\n\ - movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n\ - fmovem.x %%fp2-%%fp7,11*4(%%a0)\n\ - jra real_catch_segfault" - : : "n" (offsetof (struct sigcontext, sc_fpstate))); -} -#define catch_segfault(a,b) \ - __attribute_used__ real_catch_segfault(a,b) - -static void -hexvalue (unsigned long int value, char *buf, size_t len) -{ - char *cp = _itoa_word (value, buf + len, 16, 0); - while (cp > buf) - *--cp = '0'; -} - -static void -register_dump (int fd, struct sigcontext *ctx) -{ - char regs[20][8]; - char fpregs[11][24]; - struct iovec iov[63], *next_iov = iov; - unsigned long *p = (unsigned long *) ctx->sc_fpstate + 1; - -#define ADD_STRING(str) \ - next_iov->iov_base = (char *) (str); \ - next_iov->iov_len = strlen (str); \ - ++next_iov -#define ADD_MEM(str, len) \ - next_iov->iov_base = (str); \ - next_iov->iov_len = (len); \ - ++next_iov - - /* Generate strings of register contents. */ - hexvalue (ctx->sc_d0, regs[0], 8); - hexvalue (ctx->sc_d1, regs[1], 8); - hexvalue (*p++, regs[2], 8); - hexvalue (*p++, regs[3], 8); - hexvalue (*p++, regs[4], 8); - hexvalue (*p++, regs[5], 8); - hexvalue (*p++, regs[6], 8); - hexvalue (*p++, regs[7], 8); - hexvalue (ctx->sc_a0, regs[8], 8); - hexvalue (ctx->sc_a1, regs[9], 8); - hexvalue (*p++, regs[10], 8); - hexvalue (*p++, regs[11], 8); - hexvalue (*p++, regs[12], 8); - hexvalue (*p++, regs[13], 8); - hexvalue (*p++, regs[14], 8); - hexvalue (ctx->sc_usp, regs[15], 8); - hexvalue (ctx->sc_pc, regs[16], 8); - hexvalue (ctx->sc_sr, regs[17], 4); - hexvalue (ctx->sc_mask, regs[18], 8); - hexvalue (ctx->sc_formatvec & 0xfff, regs[19], 4); - hexvalue (ctx->sc_fpregs[0], fpregs[0], 8); - hexvalue (ctx->sc_fpregs[1], fpregs[0] + 8, 8); - hexvalue (ctx->sc_fpregs[2], fpregs[0] + 16, 8); - hexvalue (ctx->sc_fpregs[3], fpregs[1], 8); - hexvalue (ctx->sc_fpregs[4], fpregs[1] + 8, 8); - hexvalue (ctx->sc_fpregs[5], fpregs[1] + 16, 8); - hexvalue (*p++, fpregs[2], 8); - hexvalue (*p++, fpregs[2] + 8, 8); - hexvalue (*p++, fpregs[2] + 16, 8); - hexvalue (*p++, fpregs[3], 8); - hexvalue (*p++, fpregs[3] + 8, 8); - hexvalue (*p++, fpregs[3] + 16, 8); - hexvalue (*p++, fpregs[4], 8); - hexvalue (*p++, fpregs[4] + 8, 8); - hexvalue (*p++, fpregs[4] + 16, 8); - hexvalue (*p++, fpregs[5], 8); - hexvalue (*p++, fpregs[5] + 8, 8); - hexvalue (*p++, fpregs[5] + 16, 8); - hexvalue (*p++, fpregs[6], 8); - hexvalue (*p++, fpregs[6] + 8, 8); - hexvalue (*p++, fpregs[6] + 16, 8); - hexvalue (*p++, fpregs[7], 8); - hexvalue (*p++, fpregs[7] + 8, 8); - hexvalue (*p++, fpregs[7] + 16, 8); - hexvalue (ctx->sc_fpcntl[0], fpregs[8], 8); - hexvalue (ctx->sc_fpcntl[1], fpregs[9], 8); - hexvalue (ctx->sc_fpcntl[2], fpregs[10], 8); - - /* Generate the output. */ - ADD_STRING ("Register dump:\n\n D0: "); - ADD_MEM (regs[0], 8); - ADD_STRING (" D1: "); - ADD_MEM (regs[1], 8); - ADD_STRING (" D2: "); - ADD_MEM (regs[2], 8); - ADD_STRING (" D3: "); - ADD_MEM (regs[3], 8); - ADD_STRING ("\n D4: "); - ADD_MEM (regs[4], 8); - ADD_STRING (" D5: "); - ADD_MEM (regs[5], 8); - ADD_STRING (" D6: "); - ADD_MEM (regs[6], 8); - ADD_STRING (" D7: "); - ADD_MEM (regs[7], 8); - ADD_STRING ("\n A0: "); - ADD_MEM (regs[8], 8); - ADD_STRING (" A1: "); - ADD_MEM (regs[9], 8); - ADD_STRING (" A2: "); - ADD_MEM (regs[10], 8); - ADD_STRING (" A3: "); - ADD_MEM (regs[11], 8); - ADD_STRING ("\n A4: "); - ADD_MEM (regs[12], 8); - ADD_STRING (" A5: "); - ADD_MEM (regs[13], 8); - ADD_STRING (" A6: "); - ADD_MEM (regs[14], 8); - ADD_STRING (" A7: "); - ADD_MEM (regs[15], 8); - ADD_STRING ("\n PC: "); - ADD_MEM (regs[16], 8); - ADD_STRING (" SR: "); - ADD_MEM (regs[17], 4); - - ADD_STRING ("\n\n OldMask: "); - ADD_MEM (regs[18], 8); - ADD_STRING (" Vector: "); - ADD_MEM (regs[19], 4); - - ADD_STRING ("\n\n FP0: "); - ADD_MEM (fpregs[0], 24); - ADD_STRING (" FP1: "); - ADD_MEM (fpregs[1], 24); - ADD_STRING ("\n FP2: "); - ADD_MEM (fpregs[2], 24); - ADD_STRING (" FP3: "); - ADD_MEM (fpregs[3], 24); - ADD_STRING ("\n FP4: "); - ADD_MEM (fpregs[4], 24); - ADD_STRING (" FP5: "); - ADD_MEM (fpregs[5], 24); - ADD_STRING ("\n FP6: "); - ADD_MEM (fpregs[6], 24); - ADD_STRING (" FP7: "); - ADD_MEM (fpregs[7], 24); - ADD_STRING ("\n FPCR: "); - ADD_MEM (fpregs[8], 8); - ADD_STRING (" FPSR: "); - ADD_MEM (fpregs[9], 8); - ADD_STRING (" FPIAR: "); - ADD_MEM (fpregs[10], 8); - ADD_STRING ("\n"); - - /* Write the stuff out. */ - writev (fd, iov, next_iov - iov); -} - -#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/sysdeps/unix/sysv/linux/m68k/scandir64.c b/sysdeps/unix/sysv/linux/m68k/scandir64.c deleted file mode 100644 index 506fd8877c..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/scandir64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/scandir64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/semctl.c b/sysdeps/unix/sysv/linux/m68k/semctl.c deleted file mode 100644 index e9b1a483c9..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/semctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/semctl.c> diff --git a/sysdeps/unix/sysv/linux/m68k/semtimedop.S b/sysdeps/unix/sysv/linux/m68k/semtimedop.S deleted file mode 100644 index 2775c124c6..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/semtimedop.S +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de>, 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 <sysdep.h> - -#define SYSOP_semtimedop 4 - -#define SVRSP 8 /* saved register space */ -#define PARMS 4+SVRSP /* space for 3 saved regs */ -#define SEMID PARMS -#define SOPS SEMID+4 -#define NSOPS SOPS+4 -#define TIMEOUT NSOPS+4 - - .text -ENTRY (semtimedop) - - /* Save registers. */ - move.l %d2, %a1 - move.l %d3, -(%sp) - move.l %d5, -(%sp) - - move.l #SYSOP_semtimedop, %d1 - move.l SEMID(%sp), %d2 - move.l NSOPS(%sp), %d3 - move.l SOPS(%sp), %d5 - move.l TIMEOUT(%sp), %a0 - move.l #SYS_ify (ipc), %d0 - - trap #0 - - /* Restore registers. */ - move.l (%sp)+, %d5 - move.l (%sp)+, %d3 - move.l %a1, %d2 - - /* Check for error. */ - tst.l %d0 - jmi SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - ret - -PSEUDO_END (semtimedop) diff --git a/sysdeps/unix/sysv/linux/m68k/setegid.c b/sysdeps/unix/sysv/linux/m68k/setegid.c deleted file mode 100644 index 2e3a54c893..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setegid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setegid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/seteuid.c b/sysdeps/unix/sysv/linux/m68k/seteuid.c deleted file mode 100644 index 18e41d08c1..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/seteuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/seteuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setfsgid.c b/sysdeps/unix/sysv/linux/m68k/setfsgid.c deleted file mode 100644 index 0886712569..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setfsgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setfsgid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setfsuid.c b/sysdeps/unix/sysv/linux/m68k/setfsuid.c deleted file mode 100644 index a9f22eb8ab..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setfsuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setfsuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setgid.c b/sysdeps/unix/sysv/linux/m68k/setgid.c deleted file mode 100644 index 377021d9ec..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setgid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setgroups.c b/sysdeps/unix/sysv/linux/m68k/setgroups.c deleted file mode 100644 index 0e7086278f..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setgroups.c +++ /dev/null @@ -1,2 +0,0 @@ -/* We also have to rewrite the kernel gid_t to the user land type. */ -#include <sysdeps/unix/sysv/linux/i386/setgroups.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setregid.c b/sysdeps/unix/sysv/linux/m68k/setregid.c deleted file mode 100644 index 99c57ad20f..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setregid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setregid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setresgid.c b/sysdeps/unix/sysv/linux/m68k/setresgid.c deleted file mode 100644 index daca1a4833..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setresgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setresuid.c b/sysdeps/unix/sysv/linux/m68k/setresuid.c deleted file mode 100644 index 3aeabe9ad7..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setresuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setreuid.c b/sysdeps/unix/sysv/linux/m68k/setreuid.c deleted file mode 100644 index 8ad61226e9..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setreuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setreuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setrlimit.c b/sysdeps/unix/sysv/linux/m68k/setrlimit.c deleted file mode 100644 index bfaef74c38..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/sysdeps/unix/sysv/linux/m68k/setuid.c b/sysdeps/unix/sysv/linux/m68k/setuid.c deleted file mode 100644 index de394379be..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/setuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setuid.c> diff --git a/sysdeps/unix/sysv/linux/m68k/shmctl.c b/sysdeps/unix/sysv/linux/m68k/shmctl.c deleted file mode 100644 index 7eac6380dd..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/shmctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/shmctl.c> diff --git a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h b/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h deleted file mode 100644 index b7e08cfc95..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998. - - 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 SIGCONTEXT int _code, struct sigcontext * -#define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) (ctx)->sc_pc) -#define GET_FRAME(ctx) ((void *) __builtin_frame_address (1)) -#define GET_STACK(ctx) ((void *) (ctx)->sc_usp) -#define CALL_SIGHANDLER(handler, signo, ctx) \ - (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S deleted file mode 100644 index 1d10f33e17..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/socket.S +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 1996, 1997, 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 <sysdep-cancel.h> -#include <socketcall.h> - -#define P(a, b) P2(a, b) -#define P2(a, b) a##b - - .text -/* The socket-oriented system calls are handled unusally in Linux. - They are all gated through the single `socketcall' system call number. - `socketcall' takes two arguments: the first is the subcode, specifying - which socket function is being called; and the second is a pointer to - the arguments to the specific function. - - The .S files for the other calls just #define socket and #include this. */ - -#ifndef __socket -#ifndef NO_WEAK_ALIAS -#define __socket P(__,socket) -#else -#define __socket socket -#endif -#endif - -.globl __socket -ENTRY (__socket) -#if defined NEED_CANCELLATION && defined CENABLE - SINGLE_THREAD_P - jne 1f -#endif - - /* Save registers. */ - move.l %d2, %a0 - - move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */ - - /* Use ## so `socket' is a separate token that might be #define'd. */ - move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */ - lea 4(%sp), %a1 /* Address of args is 2nd arg. */ - move.l %a1, %d2 - - /* Do the system call trap. */ - trap #0 - - /* Restore registers. */ - move.l %a0, %d2 - - /* %d0 is < 0 if there was an error. */ - tst.l %d0 - jmi SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - rts - -#if defined NEED_CANCELLATION && defined CENABLE -1: /* Enable asynchronous cancellation. */ - CENABLE - - /* Save registers. */ - move.l %d2, -(%sp) - move.l %d0, -(%sp) - - move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */ - - /* Use ## so `socket' is a separate token that might be #define'd. */ - move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */ - lea 4+8(%sp), %a1 /* Address of args is 2nd arg. */ - move.l %a1, %d2 - - /* Do the system call trap. */ - trap #0 - - /* Restore cancellation. */ - move.l %d0, %d2 - CDISABLE - addq.l #4, %sp - move.l %d2, %d0 - - /* Restore registers. */ - move.l (%sp)+, %d2 - - /* %d0 is < 0 if there was an error. */ - tst.l %d0 - jmi SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - rts -#endif - -PSEUDO_END (__socket) - -#ifndef NO_WEAK_ALIAS -weak_alias (__socket, socket) -#endif diff --git a/sysdeps/unix/sysv/linux/m68k/sys/procfs.h b/sysdeps/unix/sysv/linux/m68k/sys/procfs.h deleted file mode 100644 index 27abf8ef52..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sys/procfs.h +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (C) 1996, 1997, 1999, 2000, 2001 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 _SYS_PROCFS_H -#define _SYS_PROCFS_H 1 - -/* This is somewhat modelled after the file of the same name on SVR4 - systems. It provides a definition of the core file format for ELF - used on Linux. It doesn't have anything to do with the /proc file - system, even though Linux has one. - - Anyway, the whole purpose of this file is for GDB and GDB only. - Don't read too much into it. Don't use it for anything other than - GDB unless you know what you are doing. */ - -#include <features.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/user.h> - -__BEGIN_DECLS - -/* Type for a general-purpose register. */ -typedef unsigned long elf_greg_t; - -/* And the whole bunch of them. We could have used `struct - user_regs_struct' directly in the typedef, but tradition says that - the register set is an array, which does have some peculiar - semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -/* Register set for the floating-point registers. */ -typedef struct user_m68kfp_struct elf_fpregset_t; - - -/* Signal info. */ -struct elf_siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - }; - - -/* Definitions to generate Intel SVR4-like core files. These mostly - have the same names as the SVR4 types with "elf_" tacked on the - front to prevent clashes with Linux definitions, and the typedef - forms have been avoided. This is mostly like the SVR4 structure, - but more Linuxy, with things that Linux does not support and which - GDB doesn't really use excluded. */ - -struct elf_prstatus - { - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ - elf_gregset_t pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -#define ELF_PRARGSZ (80) /* Number of chars for args. */ - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - unsigned long 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. */ - }; - - -/* The rest of this file provides the types for emulation of the - Solaris <proc_service.h> interfaces that should be implemented by - users of libthread_db. */ - -/* Addresses. */ -typedef void *psaddr_t; - -/* Register sets. Linux has different names. */ -typedef elf_gregset_t prgregset_t; -typedef elf_fpregset_t prfpregset_t; - -/* We don't have any differences between processes and threads, - therefore have only one PID type. */ -typedef __pid_t lwpid_t; - -/* Process status and info. In the end we do provide typedefs for them. */ -typedef struct elf_prstatus prstatus_t; -typedef struct elf_prpsinfo prpsinfo_t; - -__END_DECLS - -#endif /* sys/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/m68k/sys/reg.h b/sysdeps/unix/sysv/linux/m68k/sys/reg.h deleted file mode 100644 index 418f8323f1..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sys/reg.h +++ /dev/null @@ -1,89 +0,0 @@ -/* 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. */ - -#ifndef _SYS_REG_H -#define _SYS_REG_H 1 - -/* Index into an array of 4 byte integers returned from ptrace for - location of the users' stored general purpose registers. */ - -enum -{ - PT_D1 = 0, -#define PT_D1 PT_D1 - PT_D2 = 1, -#define PT_D2 PT_D2 - PT_D3 = 2, -#define PT_D3 PT_D3 - PT_D4 = 3, -#define PT_D4 PT_D4 - PT_D5 = 4, -#define PT_D5 PT_D5 - PT_D6 = 5, -#define PT_D6 PT_D6 - PT_D7 = 6, -#define PT_D7 PT_D7 - PT_A0 = 7, -#define PT_A0 PT_A0 - PT_A1 = 8, -#define PT_A1 PT_A1 - PT_A2 = 9, -#define PT_A2 PT_A2 - PT_A3 = 10, -#define PT_A3 PT_A3 - PT_A4 = 11, -#define PT_A4 PT_A4 - PT_A5 = 12, -#define PT_A5 PT_A5 - PT_A6 = 13, -#define PT_A6 PT_A6 - PT_D0 = 14, -#define PT_D0 PT_D0 - PT_USP = 15, -#define PT_USP PT_USP - PT_ORIG_D0 = 16, -#define PT_ORIG_D0 PT_ORIG_D0 - PT_SR = 17, -#define PT_SR PT_SR - PT_PC = 18, -#define PT_PC PT_PC - PT_FP0 = 21, -#define PT_FP0 PT_FP0 - PT_FP1 = 24, -#define PT_FP1 PT_FP1 - PT_FP2 = 27, -#define PT_FP2 PT_FP2 - PT_FP3 = 30, -#define PT_FP3 PT_FP3 - PT_FP4 = 33, -#define PT_FP4 PT_FP4 - PT_FP5 = 36, -#define PT_FP5 PT_FP5 - PT_FP6 = 39, -#define PT_FP6 PT_FP6 - PT_FP7 = 42, -#define PT_FP7 PT_FP7 - PT_FPCR = 45, -#define PT_FPCR PT_FPCR - PT_FPSR = 46, -#define PT_FPSR PT_FPSR - PT_FPIAR = 47 -#define PT_FPIAR PT_FPIAR -}; - -#endif /* _SYS_REG_H */ diff --git a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h deleted file mode 100644 index 3c441dc5ce..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1999, 2001 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. */ - -/* System V/m68k ABI compliant context switching support. */ - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <signal.h> - -/* Type for general register. */ -typedef int greg_t; - -/* Number of general registers. */ -#define NGREG 18 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Number of each register is the `gregset_t' array. */ -enum -{ - R_D0 = 0, -#define R_D0 R_D0 - R_D1 = 1, -#define R_D1 R_D1 - R_D2 = 2, -#define R_D2 R_D2 - R_D3 = 3, -#define R_D3 R_D3 - R_D4 = 4, -#define R_D4 R_D4 - R_D5 = 5, -#define R_D5 R_D5 - R_D6 = 6, -#define R_D6 R_D6 - R_D7 = 7, -#define R_D7 R_D7 - R_A0 = 8, -#define R_A0 R_A0 - R_A1 = 9, -#define R_A1 R_A1 - R_A2 = 10, -#define R_A2 R_A2 - R_A3 = 11, -#define R_A3 R_A3 - R_A4 = 12, -#define R_A4 R_A4 - R_A5 = 13, -#define R_A5 R_A5 - R_A6 = 14, -#define R_A6 R_A6 - R_A7 = 15, -#define R_A7 R_A7 - R_SP = 15, -#define R_SP R_SP - R_PC = 16, -#define R_PC R_PC - R_PS = 17 -#define R_PS R_PS -}; - -/* Structure to describe FPU registers. */ -typedef struct fpregset -{ - int f_fpregs[8][3]; - int f_pcr; - int f_psr; - int f_fpiaddr; -} fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct -{ - int version; - gregset_t gregs; - fpregset_t fpregs; -} mcontext_t; - -#define MCONTEXT_VERSION 2 - -/* Userlevel context. */ -typedef struct ucontext -{ - unsigned long int uc_flags; - struct ucontext *uc_link; - __sigset_t uc_sigmask; - stack_t uc_stack; - mcontext_t uc_mcontext; - long int uc_filler[174]; -} ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/unix/sysv/linux/m68k/syscall.S b/sysdeps/unix/sysv/linux/m68k/syscall.S deleted file mode 100644 index 4f2c747c27..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/syscall.S +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1996, 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 <sysdep.h> - -/* Please consult the file sysdeps/unix/sysv/linux/m68k/sysdep.h for - more information about the value -4095 used below.*/ - - .text -ENTRY (syscall) - move.l 4(%sp), %d0 /* Load syscall number. */ - _DOARGS_5 (24) /* Frob arguments. */ - trap &0 /* Do the system call. */ - UNDOARGS_5 /* Unfrob arguments. */ - cmp.l &-4095, %d0 /* Check %d0 for error. */ - jcc SYSCALL_ERROR_LABEL /* Jump to error handler if negative. */ - rts /* Return to caller. */ -PSEUDO_END (syscall) diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list deleted file mode 100644 index 98d30667bd..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/syscalls.list +++ /dev/null @@ -1,5 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush -oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 -oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S deleted file mode 100644 index e4ec92d836..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 1996, 2002 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 <sysdep.h> - - -/* The following code is only used in the shared library when we - compile the reentrant version. Otherwise each system call defines - each own version. */ - -#ifndef PIC - -/* The syscall stubs jump here when they detect an error. */ - -#undef CALL_MCOUNT -#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %d0. */ - - .text -ENTRY (__syscall_error) - neg.l %d0 -#ifndef _LIBC_REENTRANT - move.l %d0, errno -#else - move.l %d0, -(%sp) - jbsr __errno_location - move.l (%sp)+, (%a0) -#endif - move.l #-1, %d0 - /* Copy return value to %a0 for syscalls that are declared to - return a pointer. */ - move.l %d0, %a0 - rts -END (__syscall_error) -#endif /* PIC */ diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h deleted file mode 100644 index 091dfc9c7d..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ /dev/null @@ -1,295 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>, - December 1995. - - 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 <sysdeps/unix/sysdep.h> -#include <sysdeps/m68k/sysdep.h> - -/* Defines RTLD_PRIVATE_ERRNO. */ -#include <dl-sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* Linux uses a negative return value to indicate syscall errors, unlike - most Unices, which use the condition codes' carry flag. - - Since version 2.1 the return value of a system call might be negative - even if the call succeeded. E.g., the `lseek' system call might return - a large offset. Therefore we must not anymore test for < 0, but test - for a real error by making sure the value in %d0 is a real error - number. Linus said he will make sure the no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef PIC -#define SYSCALL_ERROR_LABEL .Lsyscall_error -#else -#define SYSCALL_ERROR_LABEL __syscall_error -#endif - -#undef PSEUDO -#define PSEUDO(name, syscall_name, args) \ - .text; \ - ENTRY (name) \ - DO_CALL (syscall_name, args); \ - cmp.l &-4095, %d0; \ - jcc SYSCALL_ERROR_LABEL - -#undef PSEUDO_END -#define PSEUDO_END(name) \ - SYSCALL_ERROR_HANDLER; \ - END (name) - -#undef PSEUDO_NOERRNO -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - .text; \ - ENTRY (name) \ - DO_CALL (syscall_name, args) - -#undef PSEUDO_END_NOERRNO -#define PSEUDO_END_NOERRNO(name) \ - END (name) - -#define ret_NOERRNO rts - -/* The function has to return the error code. */ -#undef PSEUDO_ERRVAL -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - .text; \ - ENTRY (name) \ - DO_CALL (syscall_name, args); \ - negl %d0 - -#undef PSEUDO_END_ERRVAL -#define PSEUDO_END_ERRVAL(name) \ - END (name) - -#define ret_ERRVAL rts - -#ifdef PIC -# if RTLD_PRIVATE_ERRNO -# define SYSCALL_ERROR_HANDLER \ -SYSCALL_ERROR_LABEL: \ - lea (rtld_errno, %pc), %a0; \ - neg.l %d0; \ - move.l %d0, (%a0); \ - move.l &-1, %d0; \ - /* Copy return value to %a0 for syscalls that are declared to return \ - a pointer (e.g., mmap). */ \ - move.l %d0, %a0; \ - rts; -# else /* !RTLD_PRIVATE_ERRNO */ -/* Store (- %d0) into errno through the GOT. */ -# if defined _LIBC_REENTRANT -# define SYSCALL_ERROR_HANDLER \ -SYSCALL_ERROR_LABEL: \ - neg.l %d0; \ - move.l %d0, -(%sp); \ - jbsr __errno_location@PLTPC; \ - move.l (%sp)+, (%a0); \ - move.l &-1, %d0; \ - /* Copy return value to %a0 for syscalls that are declared to return \ - a pointer (e.g., mmap). */ \ - move.l %d0, %a0; \ - rts; -# else /* !_LIBC_REENTRANT */ -# define SYSCALL_ERROR_HANDLER \ -SYSCALL_ERROR_LABEL: \ - move.l (errno@GOTPC, %pc), %a0; \ - neg.l %d0; \ - move.l %d0, (%a0); \ - move.l &-1, %d0; \ - /* Copy return value to %a0 for syscalls that are declared to return \ - a pointer (e.g., mmap). */ \ - move.l %d0, %a0; \ - rts; -# endif /* _LIBC_REENTRANT */ -# endif /* RTLD_PRIVATE_ERRNO */ -#else -# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ -#endif /* PIC */ - -/* Linux takes system call arguments in registers: - - syscall number %d0 call-clobbered - arg 1 %d1 call-clobbered - arg 2 %d2 call-saved - arg 3 %d3 call-saved - arg 4 %d4 call-saved - arg 5 %d5 call-saved - - The stack layout upon entering the function is: - - 20(%sp) Arg# 5 - 16(%sp) Arg# 4 - 12(%sp) Arg# 3 - 8(%sp) Arg# 2 - 4(%sp) Arg# 1 - (%sp) Return address - - (Of course a function with say 3 arguments does not have entries for - arguments 4 and 5.) - - Separate move's are faster than movem, but need more space. Since - speed is more important, we don't use movem. Since %a0 and %a1 are - scratch registers, we can use them for saving as well. */ - -#define DO_CALL(syscall_name, args) \ - move.l &SYS_ify(syscall_name), %d0; \ - DOARGS_##args \ - trap &0; \ - UNDOARGS_##args - -#define DOARGS_0 /* No arguments to frob. */ -#define UNDOARGS_0 /* No arguments to unfrob. */ -#define _DOARGS_0(n) /* No arguments to frob. */ - -#define DOARGS_1 _DOARGS_1 (4) -#define _DOARGS_1(n) move.l n(%sp), %d1; _DOARGS_0 (n) -#define UNDOARGS_1 UNDOARGS_0 - -#define DOARGS_2 _DOARGS_2 (8) -#define _DOARGS_2(n) move.l %d2, %a0; move.l n(%sp), %d2; _DOARGS_1 (n-4) -#define UNDOARGS_2 UNDOARGS_1; move.l %a0, %d2 - -#define DOARGS_3 _DOARGS_3 (12) -#define _DOARGS_3(n) move.l %d3, %a1; move.l n(%sp), %d3; _DOARGS_2 (n-4) -#define UNDOARGS_3 UNDOARGS_2; move.l %a1, %d3 - -#define DOARGS_4 _DOARGS_4 (16) -#define _DOARGS_4(n) move.l %d4, -(%sp); move.l n+4(%sp), %d4; _DOARGS_3 (n) -#define UNDOARGS_4 UNDOARGS_3; move.l (%sp)+, %d4 - -#define DOARGS_5 _DOARGS_5 (20) -#define _DOARGS_5(n) move.l %d5, -(%sp); move.l n+4(%sp), %d5; _DOARGS_4 (n) -#define UNDOARGS_5 UNDOARGS_4; move.l (%sp)+, %d5 - - -#define ret rts -#if 0 /* Not used by Linux */ -#define r0 %d0 -#define r1 %d1 -#define MOVE(x,y) movel x , y -#endif - -#else /* not __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args); \ - if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))\ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \ - _sys_result = (unsigned int) -1; \ - } \ - (int) _sys_result; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) do { } while (0) - -/* Define a macro which expands inline into the wrapper code for a system - call. This use is for internal calls that do not need to handle errors - normally. It will never touch errno. This returns just what the kernel - gave back. */ -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - ({ unsigned int _sys_result; \ - { \ - /* Load argument values in temporary variables - to perform side effects like function calls - before the call used registers are set. */ \ - LOAD_ARGS_##nr (args) \ - LOAD_REGS_##nr \ - register int _d0 asm ("%d0") = __NR_##name; \ - asm volatile ("trap #0" \ - : "=d" (_d0) \ - : "0" (_d0) ASM_ARGS_##nr \ - : "memory"); \ - _sys_result = _d0; \ - } \ - (int) _sys_result; }) - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned int) (val) >= -4095U) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) - -#define LOAD_ARGS_0() -#define LOAD_REGS_0 -#define ASM_ARGS_0 -#define LOAD_ARGS_1(a1) \ - LOAD_ARGS_0 () \ - int __arg1 = (int) (a1); -#define LOAD_REGS_1 \ - register int _d1 asm ("d1") = __arg1; \ - LOAD_REGS_0 -#define ASM_ARGS_1 ASM_ARGS_0, "d" (_d1) -#define LOAD_ARGS_2(a1, a2) \ - LOAD_ARGS_1 (a1) \ - int __arg2 = (int) (a2); -#define LOAD_REGS_2 \ - register int _d2 asm ("d2") = __arg2; \ - LOAD_REGS_1 -#define ASM_ARGS_2 ASM_ARGS_1, "d" (_d2) -#define LOAD_ARGS_3(a1, a2, a3) \ - LOAD_ARGS_2 (a1, a2) \ - int __arg3 = (int) (a3); -#define LOAD_REGS_3 \ - register int _d3 asm ("d3") = __arg3; \ - LOAD_REGS_2 -#define ASM_ARGS_3 ASM_ARGS_2, "d" (_d3) -#define LOAD_ARGS_4(a1, a2, a3, a4) \ - LOAD_ARGS_3 (a1, a2, a3) \ - int __arg4 = (int) (a4); -#define LOAD_REGS_4 \ - register int _d4 asm ("d4") = __arg4; \ - LOAD_REGS_3 -#define ASM_ARGS_4 ASM_ARGS_3, "d" (_d4) -#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ - LOAD_ARGS_4 (a1, a2, a3, a4) \ - int __arg5 = (int) (a5); -#define LOAD_REGS_5 \ - register int _d5 asm ("d5") = __arg5; \ - LOAD_REGS_4 -#define ASM_ARGS_5 ASM_ARGS_4, "d" (_d5) -#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ - LOAD_ARGS_5 (a1, a2, a3, a4, a5) \ - int __arg6 = (int) (a6); -#define LOAD_REGS_6 \ - register int _a0 asm ("a0") = __arg6; \ - LOAD_REGS_5 -#define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0) - -#endif /* not __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/m68k/versionsort64.c b/sysdeps/unix/sysv/linux/m68k/versionsort64.c deleted file mode 100644 index 144b691e56..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/versionsort64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/versionsort64.c> diff --git a/sysdeps/unix/sysv/linux/m68k/vfork.S b/sysdeps/unix/sysv/linux/m68k/vfork.S deleted file mode 100644 index 8027b2f801..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/vfork.S +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@gnu.org>. - - 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 <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#include <kernel-features.h> - -/* Clone the calling process, but without copying the whole address space. - The calling process is suspended until the new process exits or is - replaced by a call to `execve'. Return -1 for errors, 0 to the new process, - and the process ID of the new process to the old process. */ - -ENTRY (__vfork) - -#ifdef __NR_vfork - - /* Pop the return PC value into A0. */ - movel %sp@+, %a0 - - /* Stuff the syscall number in D0 and trap into the kernel. */ - movel #SYS_ify (vfork), %d0 - trap #0 - tstl %d0 - jmi .Lerror /* Branch forward if it failed. */ - - /* Jump to the return PC. */ - jmp %a0@ - -.Lerror: - /* Push back the return PC. */ - movel %a0,%sp@- - -# ifdef __ASSUME_VFORK_SYSCALL -# ifndef PIC - jbra SYSCALL_ERROR_LABEL -# endif -# else - /* Check if vfork syscall is known at all. */ - movel #-ENOSYS,%d1 - cmpl %d0,%d1 - jne SYSCALL_ERROR_LABEL - -# endif -#endif - -#ifndef __ASSUME_VFORK_SYSCALL - /* If we don't have vfork, fork is close enough. */ - - movel #SYS_ify (fork), %d0 - trap #0 - tstl %d0 - jmi SYSCALL_ERROR_LABEL - rts -#endif - -PSEUDO_END (__vfork) -libc_hidden_def (__vfork) - -weak_alias (__vfork, vfork) diff --git a/sysdeps/unix/sysv/linux/m68k/xstat.c b/sysdeps/unix/sysv/linux/m68k/xstat.c deleted file mode 100644 index e9869f5508..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/xstat.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile deleted file mode 100644 index 72fa87b3ff..0000000000 --- a/sysdeps/unix/sysv/linux/mips/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -ifeq ($(subdir),signal) -#sysdep_routines += sigsuspend -endif - -ifeq ($(subdir),misc) -sysdep_routines += cachectl cacheflush sysmips _test_and_set - -sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h - -no_syscall_list_h = 1 - -# A callable macro that expands to a shell command. Preprocess file $(1) -# using ABI option $(2) and see which macros it defines. Print FOO for each -# macro of the form __NR$(3)_FOO, filtering out ABI-specific __NR macros -# that have a prefix other than $(3). -mips_list_syscalls = $(filter-out -m%,$(CC)) -E -x c $(+includes) \ - $(sysincludes) -D_LIBC -dM -mabi=$(2) $(1) | \ - sed -n 's@^\#define __NR$(3)_\([^ ]*\) .*@\1@p' | \ - sed -e '/^[ON]32_/d' -e '/^N64_/d' -e '/^64_/d' | \ - LC_ALL=C sort - -# Generate a list of SYS_* macros from the linux __NR macros. -# -# Before version 2.6, linux had separate 32-bit and 64-bit MIPS ports, -# each with its own set of headers. The ports were merged for 2.6 and -# this merged port defines the syscalls in a slightly different way. -# There are therefore three sets of headers that we need to consider: -# -# (1) Headers from the separate 32-bit MIPS port. They just define -# a single list of __NR macros. -# -# (2) Headers from the separate 64-bit MIPS port. They unconditionally -# define syscalls for all three ABIs, with o32 syscalls prefixed -# by __NR_O32, n32 syscalls prefixed by __NR_N32 and n64 syscalls -# prefixed by plain __NR. -# -# (3) Headers from the combined port. They use the _MIPS_SIM macro to -# define the right set of syscalls for the current ABI. The syscalls -# themselves have no special ABI prefix, but the headers also define: -# -# __NR_O32_Linux{,_syscalls} -# __NR_N32_Linux{,_syscalls} -# __NR_64_Linux{,_syscalls} -# -# In case (1) we just want a simple list of SYS_* macros. In cases (2) -# and (3) we want a file that will work for all three ABIs, regardless -# of which ABI we are currently using. We also want the file to work -# if the user later moves from (2) to (3). Thus the file we create -# for (2) and (3) has the form: -# -# #if _MIPS_SIM == _ABIN32 -# # ifdef __NR_N32_open -# # define SYS_n32syscall1 __NR_N32_n32syscall1 -# # ... -# # else -# # define SYS_n32syscall1 __NR_n32syscall1 -# # ... -# # endif -# #elif _MIPS_SIM == _ABI64 -# # define SYS_n64syscall1 __NR_n64syscall1 -# # ... -# #else -# # ifdef __NR_O32_open -# # define SYS_o32syscall1 __NR_O32_o32syscall1 -# # ... -# # else -# # define SYS_o32syscall1 __NR_o32syscall1 -# # ... -# # endif -# #endif -# -# Here, __NR_N32_open and __NR_O32_open are used to detect case (2) -# over case (3). The n64 SYS_* macros can always use the normal -# ABI-less names. -$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/mips/sys/syscall.h - $(make-target-directory) - $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC $< -MD -MP \ - -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' > /dev/null - { \ - echo '/* Generated at libc build time from kernel syscall list. */';\ - echo ''; \ - echo '#ifndef _SYSCALL_H'; \ - echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \ - echo '#endif'; \ - echo ''; \ - echo '#include <sgidefs.h>'; \ - rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ - $(call mips_list_syscalls,$<,n32,_N32) > $(@:.d=.h).newn32; \ - if test -s $(@:.d=.h).newn32; then \ - if grep open $(@:.d=.h).newn32 > /dev/null; then \ - $(call mips_list_syscalls,$<,32,_O32) > $(@:.d=.h).new32; \ - $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ - else \ - $(call mips_list_syscalls,$<,32,) > $(@:.d=.h).new32; \ - $(call mips_list_syscalls,$<,n32,) > $(@:.d=.h).newn32; \ - $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ - fi; \ - echo '#if _MIPS_SIM == _ABIN32'; \ - echo '# ifdef __NR_N32_open'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_N32_\1@' < $(@:.d=.h).newn32; \ - echo '# else'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).newn32; \ - echo '# endif'; \ - echo '#elif _MIPS_SIM == _ABI64'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new64; \ - echo '#else'; \ - echo '# ifdef __NR_O32_open'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_O32_\1@' < $(@:.d=.h).new32; \ - echo '# else'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new32; \ - echo '# endif'; \ - echo '#endif'; \ - else \ - $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC -dM $< | \ - sed -n 's@^\#define __NR_\([^ ]*\) .*@\#define SYS_\1 __NR_\1@p' | \ - LC_ALL=C sort; \ - fi; \ - rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ - } > $(@:.d=.h).new - mv -f $(@:.d=.h).new $(@:.d=.h) -ifneq (,$(objpfx)) - sed $(sed-remove-objpfx) $(@:.h=.d)-t > $(@:.h=.d)-t2 - rm -f $(@:.h=.d)-t - mv -f $(@:.h=.d)-t2 $(@:.h=.d) -else - mv -f $(@:.h=.d)-t $(@:.h=.d) -endif -endif diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions deleted file mode 100644 index 50bfac5599..0000000000 --- a/sysdeps/unix/sysv/linux/mips/Versions +++ /dev/null @@ -1,31 +0,0 @@ -libc { - # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk. - # When you get an error from errlist-compat.awk, you need to add a new - # version here. Don't do this blindly, since this means changing the ABI - # for all GNU/Linux configurations. - - GLIBC_2.0 { - #errlist-compat 123 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - - # Exception handling support functions from libgcc - __register_frame; __register_frame_table; __deregister_frame; - __frame_state_for; __register_frame_info_table; - - # Needed by gcc: - _flush_cache; - - # c* - cachectl; cacheflush; - - # s* - sysmips; - } - GLIBC_2.2 { - #errlist-compat 1134 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - - # _* - _test_and_set; - } -} diff --git a/sysdeps/unix/sysv/linux/mips/_test_and_set.c b/sysdeps/unix/sysv/linux/mips/_test_and_set.c deleted file mode 100644 index 9fd48f753e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/_test_and_set.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. - - 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 the real-function versions of all inline functions - defined in sys/tas.h */ - -#include <features.h> - -#define _EXTERN_INLINE -#ifndef __USE_EXTERN_INLINES -# define __USE_EXTERN_INLINES 1 -#endif - -#include "sys/tas.h" diff --git a/sysdeps/unix/sysv/linux/mips/bits/endian.h b/sysdeps/unix/sysv/linux/mips/bits/endian.h deleted file mode 100644 index 0a3d2fabe3..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/endian.h +++ /dev/null @@ -1,16 +0,0 @@ -/* The MIPS architecture has selectable endianness. - Linux/MIPS exists in two both little and big endian flavours and we - want to be able to share the installed headerfiles between both, - so we define __BYTE_ORDER based on GCC's predefines. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#ifdef __MIPSEB__ -# define __BYTE_ORDER __BIG_ENDIAN -#else -# ifdef __MIPSEL__ -# define __BYTE_ORDER __LITTLE_ENDIAN -# endif -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/errno.h b/sysdeps/unix/sysv/linux/mips/bits/errno.h deleted file mode 100644 index 5ff11c0e77..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/errno.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Error constants. MIPS/Linux specific version. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006 - 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. */ - -#ifdef _ERRNO_H - -# undef EDOM -# undef EILSEQ -# undef ERANGE -# include <linux/errno.h> - -/* Linux has no ENOTSUP error code. */ -# define ENOTSUP EOPNOTSUPP - -# ifndef ECANCELED -# define ECANCELED 158 -# endif - -/* Support for error codes to support robust mutexes was added later, too. */ -# ifndef EOWNERDEAD -# define EOWNERDEAD 165 -# define ENOTRECOVERABLE 166 -# endif - -# ifndef __ASSEMBLER__ -/* Function to get address of global `errno' variable. */ -extern int *__errno_location (void) __THROW __attribute__ ((__const__)); - -# if !defined _LIBC || defined _LIBC_REENTRANT -/* When using threads, errno is a per-thread value. */ -# define errno (*__errno_location ()) -# endif -# endif /* !__ASSEMBLER__ */ -#endif /* _ERRNO_H */ - -#if !defined _ERRNO_H && defined __need_Emath -/* This is ugly but the kernel header is not clean enough. We must - define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is - defined. */ -# define EDOM 33 /* Math argument out of domain of function. */ -# define EILSEQ 88 /* Illegal byte sequence. */ -# define ERANGE 34 /* Math result not representable. */ -#endif /* !_ERRNO_H && __need_Emath */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h deleted file mode 100644 index aa039b4c0e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h +++ /dev/null @@ -1,194 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004 - 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 _FCNTL_H -# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." -#endif - -#include <sgidefs.h> -#include <sys/types.h> - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0x0003 -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_APPEND 0x0008 -#define O_SYNC 0x0010 -#define O_NONBLOCK 0x0080 -#define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ -#define O_EXCL 0x0400 /* not fcntl */ -#define O_NOCTTY 0x0800 /* not fcntl */ -#define O_FSYNC O_SYNC -#define O_ASYNC 0x1000 - -#ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 0x2000 /* Allow large file opens. */ -#endif - -#ifdef __USE_GNU -# define O_NOFOLLOW 0x20000 /* Do not follow links. */ -# define O_DIRECT 0x8000 /* Direct disk access hint. */ -# define O_DIRECTORY 0x10000 /* Must be a directory. */ -# define O_NOATIME 0x40000 /* Do not set atime. */ -#endif - -#define O_NDELAY O_NONBLOCK - -/* For now Linux has no synchronisity options for data and read - operations. We define the symbols here but let them do the same as - O_SYNC since this is a superset. */ -#if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ -# define O_RSYNC O_SYNC /* Synchronize read operations. */ -#endif - -/* Values for the second argument to `fcntl'. */ -#define F_DUPFD 0 /* Duplicate file descriptor. */ -#define F_GETFD 1 /* Get file descriptor flags. */ -#define F_SETFD 2 /* Set file descriptor flags. */ -#define F_GETFL 3 /* Get file status flags. */ -#define F_SETFL 4 /* Set file status flags. */ -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 14 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ -#endif - -#define F_GETLK64 33 /* Get record locking info. */ -#define F_SETLK64 34 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 35 /* Set record locking info (blocking). */ - -#if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 24 /* Get owner of socket (receiver of SIGIO). */ -# define F_GETOWN 23 /* Set owner of socket (receiver of SIGIO). */ -#endif - -#ifdef __USE_GNU -# define F_SETSIG 10 /* Set number of signal to be sent. */ -# define F_GETSIG 11 /* Get number of signal to be sent. */ -#endif - -#ifdef __USE_GNU -# define F_SETLEASE 1024 /* Set a lease. */ -# define F_GETLEASE 1025 /* Enquire what lease is active. */ -# define F_NOTIFY 1026 /* Request notfications on a directory. */ -#endif - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ -#define F_RDLCK 0 /* Read lock. */ -#define F_WRLCK 1 /* Write lock. */ -#define F_UNLCK 2 /* Remove lock. */ - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -#ifdef __USE_BSD -/* Operations for bsd flock(), also used by the kernel implementation */ -# define LOCK_SH 1 /* shared lock */ -# define LOCK_EX 2 /* exclusive lock */ -# define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -# define LOCK_UN 8 /* remove lock */ -#endif - -#ifdef __USE_GNU -# define LOCK_MAND 32 /* This is a mandatory flock: */ -# define LOCK_READ 64 /* ... which allows concurrent read operations. */ -# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ -# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ -#endif - -#ifdef __USE_GNU -/* Types of directory notifications that may be requested with F_NOTIFY. */ -# define DN_ACCESS 0x00000001 /* File accessed. */ -# define DN_MODIFY 0x00000002 /* File modified. */ -# define DN_CREATE 0x00000004 /* File created. */ -# define DN_DELETE 0x00000008 /* File removed. */ -# define DN_RENAME 0x00000010 /* File renamed. */ -# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ -# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ -#endif - -typedef 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. */ -#if _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - fcntls in o32 and n32, never has this field. */ - long int l_sysid; -#endif -#else - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ -#endif - __pid_t l_pid; /* Process holding the lock. */ -#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - flock in o32 and n32, never has this field. */ - long int pad[4]; -#endif -} flock_t; - -#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 - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -# define FAPPEND O_APPEND -# define FFSYNC O_FSYNC -# define FASYNC O_ASYNC -# define FNONBLOCK O_NONBLOCK -# define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -/* Advise to `posix_fadvise'. */ -#ifdef __USE_XOPEN2K -# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ -# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h deleted file mode 100644 index a8dcf242d3..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Structure types for pre-termios terminal ioctls. Linux/MIPS version. - Copyright (C) 1997, 1999, 2000, 2001 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 _SYS_IOCTL_H -# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." -#endif - -/* Get definition of constants for use with `ioctl'. */ -#include <asm/ioctls.h> - -struct winsize - { - unsigned short int ws_row; - unsigned short int ws_col; - unsigned short int ws_xpixel; - unsigned short int ws_ypixel; - }; - -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - char c_line; /* line discipline */ - /* Yes, this is really NCCS. */ - unsigned char c_cc[32 /* NCCS */]; /* control characters */ - }; - -/* modem lines */ -#define TIOCM_LE 0x001 /* line enable */ -#define TIOCM_DTR 0x002 /* data terminal ready */ -#define TIOCM_RTS 0x004 /* request to send */ -#define TIOCM_ST 0x010 /* secondary transmit */ -#define TIOCM_SR 0x020 /* secondary receive */ -#define TIOCM_CTS 0x040 /* clear to send */ -#define TIOCM_CAR 0x100 /* carrier detect */ -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RNG 0x200 /* ring */ -#define TIOCM_RI TIOCM_RNG -#define TIOCM_DSR 0x400 /* data set ready */ - -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 /* X.25 async */ -#define N_6PACK 7 -#define N_MASC 8 /* Mobitex module */ -#define N_R3964 9 /* Simatic R3964 module */ -#define N_PROFIBUS_FDL 10 /* Profibus */ -#define N_IRDA 11 /* Linux IR */ -#define N_SMSBLOCK 12 /* SMS block mode */ -#define N_HDLC 13 /* synchronous HDLC */ -#define N_SYNC_PPP 14 /* synchronous PPP */ -#define N_HCI 15 /* Bluetooth HCI UART */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/sysdeps/unix/sysv/linux/mips/bits/ipc.h deleted file mode 100644 index 1f629ce665..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/ipc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 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 _SYS_IPC_H -# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." -#endif - -#include <bits/types.h> - -/* Mode bits for `msgget', `semget', and `shmget'. */ -#define IPC_CREAT 01000 /* Create key if key does not exist. */ -#define IPC_EXCL 02000 /* Fail if key exists. */ -#define IPC_NOWAIT 04000 /* Return error on wait. */ - -/* Control commands for `msgctl', `semctl', and `shmctl'. */ -#define IPC_RMID 0 /* Remove identifier. */ -#define IPC_SET 1 /* Set `ipc_perm' options. */ -#define IPC_STAT 2 /* Get `ipc_perm' options. */ -#ifdef __USE_GNU -# define IPC_INFO 3 /* See ipcs. */ -#endif - -/* Special key values. */ -#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ - - -/* Data structure used to pass permission information to IPC operations. */ -struct ipc_perm - { - __key_t __key; /* Key. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ - unsigned short int __pad1; - unsigned long int __unused1; - unsigned long int __unused2; -}; diff --git a/sysdeps/unix/sysv/linux/mips/bits/mman.h b/sysdeps/unix/sysv/linux/mips/bits/mman.h deleted file mode 100644 index e287e3b378..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/mman.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux/MIPS version. - Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006 - 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 _SYS_MMAN_H -# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." -#endif - -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. */ - - -/* Protections are chosen from these bits, OR'd together. The - implementation does not necessarily support PROT_EXEC or PROT_WRITE - without PROT_READ. The only guarantees are that no writing will be - allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ - -#define PROT_READ 0x1 /* Page can be read. */ -#define PROT_WRITE 0x2 /* Page can be written. */ -#define PROT_EXEC 0x4 /* Page can be executed. */ -#define PROT_NONE 0x0 /* Page can not be accessed. */ -#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of - growsdown vma (mprotect only). */ -#define PROT_GROWSUP 0x02000000 /* Extend change to start of - growsup vma (mprotect only). */ - -/* Sharing types (must choose one and only one of these). */ -#define MAP_SHARED 0x01 /* Share changes. */ -#define MAP_PRIVATE 0x02 /* Changes are private. */ -#ifdef __USE_MISC -# define MAP_TYPE 0x0f /* Mask for type of mapping. */ -#endif - -/* Other flags. */ -#define MAP_FIXED 0x10 /* Interpret addr exactly. */ -#ifdef __USE_MISC -# define MAP_FILE 0x00 -# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */ -# define MAP_ANON MAP_ANONYMOUS -# define MAP_RENAME MAP_ANONYMOUS -#endif - -/* These are Linux-specific. */ -#ifdef __USE_MISC -# define MAP_NORESERVE 0x0400 /* don't check for reservations */ -# define MAP_ANONYMOUS 0x0800 /* don't use a file */ -# define MAP_GROWSDOWN 0x1000 /* stack-like segment */ -# define MAP_DENYWRITE 0x2000 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */ -# define MAP_LOCKED 0x8000 /* pages are locked */ -# define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ -# define MAP_NONBLOCK 0x20000 /* do not block on IO */ -#endif - -/* Flags to `msync'. */ -#define MS_ASYNC 1 /* Sync memory asynchronously. */ -#define MS_INVALIDATE 2 /* Invalidate the caches. */ -#define MS_SYNC 4 /* Synchronous memory sync. */ - -/* Flags for `mlockall'. */ -#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ -#define MCL_FUTURE 2 /* Lock all additions to address - space. */ - -/* Advice to `madvise'. */ -#ifdef __USE_BSD -#define MADV_NORMAL 0 /* default page-in behavior */ -#define MADV_RANDOM 1 /* page-in minimum required */ -#define MADV_SEQUENTIAL 2 /* read-ahead aggressively */ -#define MADV_WILLNEED 3 /* pre-fault pages */ -#define MADV_DONTNEED 4 /* discard these pages */ -#define MADV_REMOVE 5 /* remove these pages & resources */ -#endif - -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/msq.h b/sysdeps/unix/sysv/linux/mips/bits/msq.h deleted file mode 100644 index c2c1dd2e85..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/msq.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 2002 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 _SYS_MSG_H -# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." -#endif - -#include <bits/types.h> - -/* Define options for message queue functions. */ -#define MSG_NOERROR 010000 /* no error if message is too big */ -#ifdef __USE_GNU -# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ -#endif - -/* Types used in the structure definition. */ -typedef unsigned long int msgqnum_t; -typedef unsigned long int msglen_t; - - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ - __time_t msg_stime; /* time of last msgsnd command */ - __time_t msg_rtime; /* time of last msgrcv command */ - __time_t msg_ctime; /* time of last change */ - unsigned long int __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() */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -#ifdef __USE_MISC - -# define msg_cbytes __msg_cbytes - -/* ipcs ctl commands */ -# define MSG_STAT 11 -# define MSG_INFO 12 - -/* buffer for msgctl calls IPC_INFO, MSG_INFO */ -struct msginfo - { - int msgpool; - int msgmap; - int msgmax; - int msgmnb; - int msgmni; - int msgssz; - int msgtql; - unsigned short int msgseg; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h deleted file mode 100644 index f62b9c3948..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/poll.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1997, 2001 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 _SYS_POLL_H -# error "Never use <bits/poll.h> directly; include <sys/poll.h> 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. */ - -#ifdef __USE_XOPEN -/* 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 -/* This is an extension for Linux. */ -# define POLLMSG 0x400 -#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. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h deleted file mode 100644 index 7e7152935b..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/resource.h +++ /dev/null @@ -1,225 +0,0 @@ -/* Bit values & structures for resource limits. Linux/MIPS version. - Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005 - 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 _SYS_RESOURCE_H -# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." -#endif - -#include <bits/types.h> - -/* 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 = 7, -#define RLIMIT_RSS __RLIMIT_RSS - - /* Number of open files. */ - RLIMIT_NOFILE = 5, - __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ -#define RLIMIT_NOFILE RLIMIT_NOFILE -#define RLIMIT_OFILE __RLIMIT_OFILE - - /* Address space limit (?) */ - RLIMIT_AS = 6, -#define RLIMIT_AS RLIMIT_AS - - /* Number of processes. */ - __RLIMIT_NPROC = 8, -#define RLIMIT_NPROC __RLIMIT_NPROC - - /* Locked-in-memory address space. */ - __RLIMIT_MEMLOCK = 9, -#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 - - __RLIMIT_NLIMITS = 15, - __RLIM_NLIMITS = __RLIMIT_NLIMITS -#define RLIMIT_NLIMITS __RLIMIT_NLIMITS -#define RLIM_NLIMITS __RLIM_NLIMITS -}; - -/* Value to indicate that there is no limit. */ -#ifndef __USE_FILE_OFFSET64 -# define RLIM_INFINITY ((long int)(~0UL >> 1)) -#else -# define RLIM_INFINITY 0x7fffffffffffffffLL -#endif - -#ifdef __USE_LARGEFILE64 -# define RLIM64_INFINITY 0x7fffffffffffffffLL -#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 -}; - -#define __need_timeval -#include <bits/time.h> /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage - { - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; - }; - -/* 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 -}; diff --git a/sysdeps/unix/sysv/linux/mips/bits/sem.h b/sysdeps/unix/sysv/linux/mips/bits/sem.h deleted file mode 100644 index 6282de9cc8..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sem.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 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 _SYS_SEM_H -# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." -#endif - -#include <sys/types.h> - -/* Flags for `semop'. */ -#define SEM_UNDO 0x1000 /* undo the operation on exit */ - -/* Commands for `semctl'. */ -#define GETPID 11 /* get sempid */ -#define GETVAL 12 /* get semval */ -#define GETALL 13 /* get all semval's */ -#define GETNCNT 14 /* get semncnt */ -#define GETZCNT 15 /* get semzcnt */ -#define SETVAL 16 /* set semval */ -#define SETALL 17 /* set all semval's */ - - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __time_t sem_otime; /* last semop() time */ - __time_t sem_ctime; /* last time changed by semctl() */ - unsigned long int sem_nsems; /* number of semaphores in set */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -/* The user should define a union like the following to use it for arguments - for `semctl'. - - union semun - { - int val; <= value for SETVAL - struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET - unsigned short int *array; <= array for GETALL & SETALL - struct seminfo *__buf; <= buffer for IPC_INFO - }; - - Previous versions of this file used to define this union but this is - incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether - one must define the union or not. */ -#define _SEM_SEMUN_UNDEFINED 1 - -#ifdef __USE_MISC - -/* ipcs ctl cmds */ -# define SEM_STAT 18 -# define SEM_INFO 19 - -struct seminfo -{ - int semmap; - int semmni; - int semmns; - int semmnu; - int semmsl; - int semopm; - int semume; - int semusz; - int semvmx; - int semaem; -}; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h deleted file mode 100644 index b3083346dd..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/shm.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003 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 _SYS_SHM_H -# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." -#endif - -#include <bits/types.h> - -/* Permission flag for shmget. */ -#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ -#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ - -/* Flags for `shmat'. */ -#define SHM_RDONLY 010000 /* attach read-only else read-write */ -#define SHM_RND 020000 /* round attach address to SHMLBA */ -#define SHM_REMAP 040000 /* take-over region on attach */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - -/* Segment low boundary address multiple. */ -#define SHMLBA 0x40000 - - -/* Type to count number of attaches. */ -typedef unsigned long int shmatt_t; - -/* Data structure describing a set of semaphores. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __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() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - unsigned long int __unused1; - unsigned long int __unused2; - }; - -#ifdef __USE_MISC - -/* ipcs ctl commands */ -# define SHM_STAT 13 -# define SHM_INFO 14 - -/* shm_mode upper byte flags */ -# define SHM_DEST 01000 /* segment will be destroyed on last detach */ -# define SHM_LOCKED 02000 /* segment will not be swapped */ -# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ - -struct shminfo - { - unsigned long int shmmax; - unsigned long int shmmin; - unsigned long int shmmni; - unsigned long int shmseg; - unsigned long int shmall; - unsigned long int __unused1; - unsigned long int __unused2; - unsigned long int __unused3; - unsigned long int __unused4; - }; - -struct shm_info - { - int used_ids; - unsigned long int shm_tot; /* total allocated shm */ - unsigned long int shm_rss; /* total resident shm */ - unsigned long int shm_swp; /* total swapped shm */ - unsigned long int swap_attempts; - unsigned long int swap_successes; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h deleted file mode 100644 index d04e25f76f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h +++ /dev/null @@ -1,89 +0,0 @@ -/* The proper definitions for Linux/MIPS's sigaction. - Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003 - 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 _SIGNAL_H -# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." -#endif - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Special flags. */ - unsigned int sa_flags; - - /* Signal handler. */ -#ifdef __USE_POSIX199309 - 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; - - /* The ABI says here are two unused ints following. */ - /* Restore handler. */ - void (*sa_restorer) (void); - -#if _MIPS_SZPTR < 64 - int sa_resv[1]; -#endif - }; - -/* Bits in `sa_flags'. */ -/* Please note that some Linux kernels versions use different values for these - flags which is a bug in those kernel versions. */ -#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ -#define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ -#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with - three arguments instead of one. */ -#if defined __USE_UNIX98 || defined __USE_MISC -# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ -# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ -# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ -# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when - its handler is being executed. */ -#endif -#ifdef __USE_MISC -# define SA_INTERRUPT 0x20000000 /* 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_NOP 0 /* 0 is unused to catch errors */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ -#ifdef __USE_MISC -# define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: - set only the low 32 bit of the sigset. */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h deleted file mode 100644 index 079964ed46..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 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 _SIGNAL_H && !defined _SYS_UCONTEXT_H -# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." -#endif - -#include <sgidefs.h> - -#ifndef sigcontext_struct -/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ -# define sigcontext_struct sigcontext - -/* # include <asm/sigcontext.h> */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste the - contents here. In case you're wondering about the different - licenses, the fact that the file is pasted, instead of included, - doesn't really make any difference for the program that includes - this header. */ -#if _MIPS_SIM == _ABIO32 -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 2000 by Ralf Baechle - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ -struct sigcontext { - unsigned int sc_regmask; /* Unused */ - unsigned int sc_status; - unsigned long long sc_pc; - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned int sc_ownedfp; /* Unused */ - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; /* Unused */ - unsigned int sc_used_math; - unsigned int sc_ssflags; /* Unused */ - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - - unsigned int sc_cause; /* Unused */ - unsigned int sc_badvaddr; /* Unused */ - - unsigned long sc_sigset[4]; /* kernel's sigset_t */ -}; - -#endif /* _ASM_SIGCONTEXT_H */ -#else /* _MIPS_SIM != _ABIO32 */ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 1999 by Ralf Baechle - * Copyright (C) 1999 Silicon Graphics, Inc. - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ -struct sigcontext { - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - unsigned long long sc_pc; - unsigned int sc_status; - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; - unsigned int sc_used_math; - unsigned int sc_cause; - unsigned int sc_badvaddr; -}; - -#endif /* _ASM_SIGCONTEXT_H */ -#endif /* _MIPS_SIM != _ABIO32 */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/sysdeps/unix/sysv/linux/mips/bits/siginfo.h deleted file mode 100644 index 787e365139..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h +++ /dev/null @@ -1,310 +0,0 @@ -/* siginfo_t, sigevent and constants. Linux/MIPS version. - Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - 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 _SIGNAL_H && !defined __need_siginfo_t \ - && !defined __need_sigevent_t -# error "Never include this file directly. Use <signal.h> instead" -#endif - -#include <bits/wordsize.h> - -#if (!defined __have_sigval_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t \ - || defined __need_sigevent_t)) -# define __have_sigval_t 1 - -/* Type for data associated with a signal. */ -typedef union sigval - { - int sival_int; - void *sival_ptr; - } sigval_t; -#endif - -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 - -# define __SI_MAX_SIZE 128 -# if __WORDSIZE == 64 -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) -# else -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) -# endif - - -typedef struct siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Signal code. */ - int si_errno; /* If non-zero, an errno value associated with - this signal, as defined in <errno.h>. */ - int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3]; - /* Explicit padding. */ - - union - { - int _pad[__SI_PAD_SIZE]; - - /* kill(). */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - } _kill; - - /* SIGCHLD. */ - struct - { - __pid_t si_pid; /* Which child. */ - __uid_t si_uid; /* Real user ID of sending process. */ - int si_status; /* Exit value or signal. */ - __clock_t si_utime; - __clock_t si_stime; - } _sigchld; - - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ - struct - { - void *si_addr; /* Faulting insn/memory ref. */ - } _sigfault; - - /* SIGPOLL. */ - struct - { - int si_band; /* Band event for SIGPOLL. */ - int si_fd; - } _sigpoll; - - /* POSIX.1b timers. */ - struct - { - unsigned int _timer1; - unsigned int _timer2; - } _timer; - - /* POSIX.1b signals. */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - sigval_t si_sigval; /* Signal value. */ - } _rt; - } _sifields; - } siginfo_t; - - -/* X/Open requires some more fields with fixed names. */ -# define si_pid _sifields._kill.si_pid -# define si_uid _sifields._kill.si_uid -# define si_status _sifields._sigchld.si_status -# define si_utime _sifields._sigchld.si_utime -# define si_stime _sifields._sigchld.si_stime -# define si_value _sifields._rt.si_sigval -# define si_int _sifields._rt.si_sigval.sival_int -# define si_ptr _sifields._rt.si_sigval.sival_ptr -# define si_addr _sifields._sigfault.si_addr -# define si_band _sifields._sigpoll.si_band -# define si_fd _sifields._sigpoll.si_fd - - -/* Values for `si_code'. Positive values are reserved for kernel-generated - signals. */ -enum -{ - SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ -# define SI_ASYNCNL SI_ASYNCNL - SI_TKILL = -6, /* Sent by tkill. */ -# define SI_TKILL SI_TKILL - SI_SIGIO, /* Sent by queued SIGIO. */ -# define SI_SIGIO SI_SIGIO - SI_MESGQ, /* Sent by real time mesq state change. */ -# define SI_MESGQ SI_MESGQ - SI_TIMER, /* Sent by real time mesq state change. */ -# define SI_TIMER SI_TIMER - SI_ASYNCIO, /* Sent by AIO completion. */ -# define SI_ASYNCIO SI_ASYNCIO - SI_QUEUE, /* Sent by sigqueue. */ -# define SI_QUEUE SI_QUEUE - SI_USER, /* Sent by kill, sigsend, raise. */ -# define SI_USER SI_USER - SI_KERNEL = 0x80 /* Send by kernel. */ -#define SI_KERNEL SI_KERNEL -}; - - -/* `si_code' values for SIGILL signal. */ -enum -{ - ILL_ILLOPC = 1, /* Illegal opcode. */ -# define ILL_ILLOPC ILL_ILLOPC - ILL_ILLOPN, /* Illegal operand. */ -# define ILL_ILLOPN ILL_ILLOPN - ILL_ILLADR, /* Illegal addressing mode. */ -# define ILL_ILLADR ILL_ILLADR - ILL_ILLTRP, /* Illegal trap. */ -# define ILL_ILLTRP ILL_ILLTRP - ILL_PRVOPC, /* Privileged opcode. */ -# define ILL_PRVOPC ILL_PRVOPC - ILL_PRVREG, /* Privileged register. */ -# define ILL_PRVREG ILL_PRVREG - ILL_COPROC, /* Coprocessor error. */ -# define ILL_COPROC ILL_COPROC - ILL_BADSTK /* Internal stack error. */ -# define ILL_BADSTK ILL_BADSTK -}; - -/* `si_code' values for SIGFPE signal. */ -enum -{ - FPE_INTDIV = 1, /* Integer divide by zero. */ -# define FPE_INTDIV FPE_INTDIV - FPE_INTOVF, /* Integer overflow. */ -# define FPE_INTOVF FPE_INTOVF - FPE_FLTDIV, /* Floating point divide by zero. */ -# define FPE_FLTDIV FPE_FLTDIV - FPE_FLTOVF, /* Floating point overflow. */ -# define FPE_FLTOVF FPE_FLTOVF - FPE_FLTUND, /* Floating point underflow. */ -# define FPE_FLTUND FPE_FLTUND - FPE_FLTRES, /* Floating point inexact result. */ -# define FPE_FLTRES FPE_FLTRES - FPE_FLTINV, /* Floating point invalid operation. */ -# define FPE_FLTINV FPE_FLTINV - FPE_FLTSUB /* Subscript out of range. */ -# define FPE_FLTSUB FPE_FLTSUB -}; - -/* `si_code' values for SIGSEGV signal. */ -enum -{ - SEGV_MAPERR = 1, /* Address not mapped to object. */ -# define SEGV_MAPERR SEGV_MAPERR - SEGV_ACCERR /* Invalid permissions for mapped object. */ -# define SEGV_ACCERR SEGV_ACCERR -}; - -/* `si_code' values for SIGBUS signal. */ -enum -{ - BUS_ADRALN = 1, /* Invalid address alignment. */ -# define BUS_ADRALN BUS_ADRALN - BUS_ADRERR, /* Non-existant physical address. */ -# define BUS_ADRERR BUS_ADRERR - BUS_OBJERR /* Object specific hardware error. */ -# define BUS_OBJERR BUS_OBJERR -}; - -/* `si_code' values for SIGTRAP signal. */ -enum -{ - TRAP_BRKPT = 1, /* Process breakpoint. */ -# define TRAP_BRKPT TRAP_BRKPT - TRAP_TRACE /* Process trace trap. */ -# define TRAP_TRACE TRAP_TRACE -}; - -/* `si_code' values for SIGCHLD signal. */ -enum -{ - CLD_EXITED = 1, /* Child has exited. */ -# define CLD_EXITED CLD_EXITED - CLD_KILLED, /* Child was killed. */ -# define CLD_KILLED CLD_KILLED - CLD_DUMPED, /* Child terminated abnormally. */ -# define CLD_DUMPED CLD_DUMPED - CLD_TRAPPED, /* Traced child has trapped. */ -# define CLD_TRAPPED CLD_TRAPPED - CLD_STOPPED, /* Child has stopped. */ -# define CLD_STOPPED CLD_STOPPED - CLD_CONTINUED /* Stopped child has continued. */ -# define CLD_CONTINUED CLD_CONTINUED -}; - -/* `si_code' values for SIGPOLL signal. */ -enum -{ - POLL_IN = 1, /* Data input available. */ -# define POLL_IN POLL_IN - POLL_OUT, /* Output buffers available. */ -# define POLL_OUT POLL_OUT - POLL_MSG, /* Input message available. */ -# define POLL_MSG POLL_MSG - POLL_ERR, /* I/O error. */ -# define POLL_ERR POLL_ERR - POLL_PRI, /* High priority input available. */ -# define POLL_PRI POLL_PRI - POLL_HUP /* Device disconnected. */ -# define POLL_HUP POLL_HUP -}; - -# undef __need_siginfo_t -#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ - - -#if (defined _SIGNAL_H || defined __need_sigevent_t) \ - && !defined __have_sigevent_t -# define __have_sigevent_t 1 - -/* Structure to transport application-defined values with signals. */ -# define __SIGEV_MAX_SIZE 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) - -/* Forward declaration of the `pthread_attr_t' type. */ -struct __pthread_attr_s; - -/* XXX This one might need to change!!! */ -typedef struct sigevent - { - sigval_t sigev_value; - int sigev_signo; - int sigev_notify; - - union - { - int _pad[__SIGEV_PAD_SIZE]; - - struct - { - void (*_function) (sigval_t); /* Function to start. */ - void *_attribute; /* Really pthread_attr_t. */ - } _sigev_thread; - } _sigev_un; - } sigevent_t; - -/* POSIX names to access some of the members. */ -# define sigev_notify_function _sigev_un._sigev_thread._function -# define sigev_notify_attributes _sigev_un._sigev_thread._attribute - -/* `sigev_notify' values. */ -enum -{ - SIGEV_SIGNAL = 0, /* Notify via signal. */ -# define SIGEV_SIGNAL SIGEV_SIGNAL - SIGEV_NONE, /* Other notification: meaningless. */ -# define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD, /* Deliver via thread creation. */ -# define SIGEV_THREAD SIGEV_THREAD - - SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ -#define SIGEV_THREAD_ID SIGEV_THREAD_ID -}; - -#endif /* have _SIGNAL_H. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/signum.h b/sysdeps/unix/sysv/linux/mips/bits/signum.h deleted file mode 100644 index a9b6848346..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/signum.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995, 1997, 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. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -#ifdef __USE_UNIX98 -# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ -#endif - - -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGEMT 7 -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* BUS error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power failure restart (System V). */ -#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ -#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */ -#define SIGIO 22 /* I/O now possible (4.2 BSD). */ -#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ -#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 24 /* Keyboard stop (POSIX). */ -#define SIGCONT 25 /* Continue (POSIX). */ -#define SIGTTIN 26 /* Background read from tty (POSIX). */ -#define SIGTTOU 27 /* Background write to tty (POSIX). */ -#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ -#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ - - -#define _NSIG 128 /* Biggest signal number + 1 - (including real-time signals). */ - -#define SIGRTMIN (__libc_current_sigrtmin ()) -#define SIGRTMAX (__libc_current_sigrtmax ()) - -/* These are the hard limits of the kernel. These values should not be - used directly at user level. */ -#define __SIGRTMIN 32 -#define __SIGRTMAX (_NSIG - 1) - -#endif /* <signal.h> included. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h b/sysdeps/unix/sysv/linux/mips/bits/sigstack.h deleted file mode 100644 index d2c8552209..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h +++ /dev/null @@ -1,55 +0,0 @@ -/* sigstack, sigaltstack definitions. - Copyright (C) 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 _SIGNAL_H -# error "Never include this file directly. Use <signal.h> instead" -#endif - - -/* Structure describing a signal stack (obsolete). */ -struct sigstack - { - void *ss_sp; /* Signal stack pointer. */ - int ss_onstack; /* Nonzero if executing on this stack. */ - }; - - -/* Possible values for `ss_flags.'. */ -enum -{ - SS_ONSTACK = 1, -#define SS_ONSTACK SS_ONSTACK - SS_DISABLE -#define SS_DISABLE SS_DISABLE -}; - -/* Minimum stack size for a signal handler. */ -#define MINSIGSTKSZ 2048 - -/* System default stack size. */ -#define SIGSTKSZ 8192 - - -/* Alternate, preferred interface. */ -typedef struct sigaltstack - { - void *ss_sp; - size_t ss_size; - int ss_flags; - } stack_t; diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h deleted file mode 100644 index 0e4a2beac7..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ /dev/null @@ -1,315 +0,0 @@ -/* System-specific socket constants and types. Linux/MIPS version. - Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006 - 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 __BITS_SOCKET_H -#define __BITS_SOCKET_H - -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H -# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead." -#endif - -#define __need_size_t -#define __need_NULL -#include <stddef.h> - -#include <limits.h> -#include <sys/types.h> - -/* Type for length arguments in socket calls. */ -#ifndef __socklen_t_defined -typedef __socklen_t socklen_t; -# define __socklen_t_defined -#endif - -/* Types of sockets. */ -enum __socket_type -{ - SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams - of fixed maximum length. */ -#define SOCK_DGRAM SOCK_DGRAM - SOCK_STREAM = 2, /* Sequenced, reliable, connection-based - byte streams. */ -#define SOCK_STREAM SOCK_STREAM - 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_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 -}; - -/* Protocol families. */ -#define PF_UNSPEC 0 /* Unspecified. */ -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ -#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ -#define PF_INET 2 /* IP protocol family. */ -#define PF_AX25 3 /* Amateur Radio AX.25. */ -#define PF_IPX 4 /* Novell Internet Protocol. */ -#define PF_APPLETALK 5 /* Appletalk DDP. */ -#define PF_NETROM 6 /* Amateur radio NetROM. */ -#define PF_BRIDGE 7 /* Multiprotocol bridge. */ -#define PF_ATMPVC 8 /* ATM PVCs. */ -#define PF_X25 9 /* Reserved for X.25 project. */ -#define PF_INET6 10 /* IP version 6. */ -#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ -#define PF_DECnet 12 /* Reserved for DECnet project. */ -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ -#define PF_SECURITY 14 /* Security callback pseudo AF. */ -#define PF_KEY 15 /* PF_KEY key management API. */ -#define PF_NETLINK 16 -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ -#define PF_PACKET 17 /* Packet family. */ -#define PF_ASH 18 /* Ash. */ -#define PF_ECONET 19 /* Acorn Econet. */ -#define PF_ATMSVC 20 /* ATM SVCs. */ -#define PF_SNA 22 /* Linux SNA Project */ -#define PF_IRDA 23 /* IRDA sockets. */ -#define PF_PPPOX 24 /* PPPoX sockets. */ -#define PF_WANPIPE 25 /* Wanpipe API sockets. */ -#define PF_BLUETOOTH 31 /* Bluetooth sockets. */ -#define PF_MAX 32 /* For now.. */ - -/* Address families. */ -#define AF_UNSPEC PF_UNSPEC -#define AF_LOCAL PF_LOCAL -#define AF_UNIX PF_UNIX -#define AF_FILE PF_FILE -#define AF_INET PF_INET -#define AF_AX25 PF_AX25 -#define AF_IPX PF_IPX -#define AF_APPLETALK PF_APPLETALK -#define AF_NETROM PF_NETROM -#define AF_BRIDGE PF_BRIDGE -#define AF_ATMPVC PF_ATMPVC -#define AF_X25 PF_X25 -#define AF_INET6 PF_INET6 -#define AF_ROSE PF_ROSE -#define AF_DECnet PF_DECnet -#define AF_NETBEUI PF_NETBEUI -#define AF_SECURITY PF_SECURITY -#define AF_KEY PF_KEY -#define AF_NETLINK PF_NETLINK -#define AF_ROUTE PF_ROUTE -#define AF_PACKET PF_PACKET -#define AF_ASH PF_ASH -#define AF_ECONET PF_ECONET -#define AF_ATMSVC PF_ATMSVC -#define AF_SNA PF_SNA -#define AF_IRDA PF_IRDA -#define AF_PPPOX PF_PPPOX -#define AF_WANPIPE PF_WANPIPE -#define AF_BLUETOOTH PF_BLUETOOTH -#define AF_MAX PF_MAX - -/* Socket level values. Others are defined in the appropriate headers. - - XXX These definitions also should go into the appropriate headers as - far as they are available. */ -#define SOL_RAW 255 -#define SOL_DECNET 261 -#define SOL_X25 262 -#define SOL_PACKET 263 -#define SOL_ATM 264 /* ATM layer (cell level). */ -#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ -#define SOL_IRDA 266 - -/* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 - -/* Get the definition of the macro to define the common sockaddr members. */ -#include <bits/sockaddr.h> - -/* Structure describing a generic socket address. */ -struct sockaddr - { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ - }; - - -/* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ -#if ULONG_MAX > 0xffffffff -# define __ss_aligntype __uint64_t -#else -# define __ss_aligntype __uint32_t -#endif -#define _SS_SIZE 128 -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) - -struct sockaddr_storage - { - __SOCKADDR_COMMON (ss_); /* Address family, etc. */ - __ss_aligntype __ss_align; /* Force desired alignment. */ - char __ss_padding[_SS_PADSIZE]; - }; - - -/* Bits in the FLAGS argument to `send', `recv', et al. */ -enum - { - MSG_OOB = 0x01, /* Process out-of-band data. */ -#define MSG_OOB MSG_OOB - MSG_PEEK = 0x02, /* Peek at incoming messages. */ -#define MSG_PEEK MSG_PEEK - MSG_DONTROUTE = 0x04, /* Don't use local routing. */ -#define MSG_DONTROUTE MSG_DONTROUTE -#ifdef __USE_GNU - /* DECnet uses a different name. */ - MSG_TRYHARD = MSG_DONTROUTE, -# define MSG_TRYHARD MSG_DONTROUTE -#endif - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ -#define MSG_CTRUNC MSG_CTRUNC - MSG_PROXY = 0x10, /* Supply or ask second address. */ -#define MSG_PROXY MSG_PROXY - MSG_TRUNC = 0x20, -#define MSG_TRUNC MSG_TRUNC - MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ -#define MSG_DONTWAIT MSG_DONTWAIT - MSG_EOR = 0x80, /* End of record. */ -#define MSG_EOR MSG_EOR - MSG_WAITALL = 0x100, /* Wait for a full request. */ -#define MSG_WAITALL MSG_WAITALL - MSG_FIN = 0x200, -#define MSG_FIN MSG_FIN - MSG_SYN = 0x400, -#define MSG_SYN MSG_SYN - MSG_CONFIRM = 0x800, /* Confirm path validity. */ -#define MSG_CONFIRM MSG_CONFIRM - MSG_RST = 0x1000, -#define MSG_RST MSG_RST - MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ -#define MSG_ERRQUEUE MSG_ERRQUEUE - MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ -#define MSG_NOSIGNAL MSG_NOSIGNAL - MSG_MORE = 0x8000 /* Sender will send more. */ -#define MSG_MORE MSG_MORE - }; - - -/* Structure describing messages sent by - `sendmsg' and received by `recvmsg'. */ -struct msghdr - { - void *msg_name; /* Address to send to/receive from. */ - socklen_t msg_namelen; /* Length of address data. */ - - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ - - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ - size_t msg_controllen; /* Ancillary data buffer length. */ - - int msg_flags; /* Flags on received message. */ - }; - -/* Structure used for storage of ancillary data object information. */ -struct cmsghdr - { - size_t cmsg_len; /* Length of data in cmsg_data plus length - of cmsghdr structure. */ - int cmsg_level; /* Originating protocol. */ - int cmsg_type; /* Protocol specific type. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ -#endif - }; - -/* Ancillary data object manipulation macros. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) -#else -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) -#endif -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) -#define CMSG_FIRSTHDR(mhdr) \ - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ - & (size_t) ~(sizeof (size_t) - 1)) -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ - + CMSG_ALIGN (sizeof (struct cmsghdr))) -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) - -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, - struct cmsghdr *__cmsg) __THROW; -#ifdef __USE_EXTERN_INLINES -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif -_EXTERN_INLINE struct cmsghdr * -__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) -{ - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) - /* The kernel header does this so there may be a reason. */ - return 0; - - __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg - + CMSG_ALIGN (__cmsg->cmsg_len)); - if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control - + __mhdr->msg_controllen) - || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) - /* No more entries. */ - return 0; - return __cmsg; -} -#endif /* Use `extern inline'. */ - -/* Socket level message types. This must match the definitions in - <linux/socket.h>. */ -enum - { - SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ -#define SCM_RIGHTS SCM_RIGHTS -#ifdef __USE_BSD - , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ -# define SCM_CREDENTIALS SCM_CREDENTIALS -#endif - }; - -/* User visible structure for SCM_CREDENTIALS message */ - -struct ucred -{ - pid_t pid; /* PID of sending process. */ - uid_t uid; /* UID of sending process. */ - gid_t gid; /* GID of sending process. */ -}; - -/* Get socket manipulation related informations from kernel headers. */ -#include <asm/socket.h> - - -/* Structure used to manipulate the SO_LINGER option. */ -struct linger - { - int l_onoff; /* Nonzero to linger on close. */ - int l_linger; /* Time to linger. */ - }; - -#endif /* bits/socket.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h deleted file mode 100644 index 9ae38cd8d0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/stat.h +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 - 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 _SYS_STAT_H -# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." -#endif - -#include <sgidefs.h> - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ - - -#if _MIPS_SIM == _ABIO32 -/* Structure describing file characteristics. */ -struct stat - { - unsigned long int st_dev; - long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -#else - __ino64_t st_ino; /* File serial number. */ -#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.*/ - unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 - long int st_pad2[2]; - __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long int st_pad3; -#else - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -#endif - /* - * Actually this should be timestruc_t st_atime, st_mtime and - * st_ctime but we don't have it under Linux. - */ - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; - __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else - long int st_pad4; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif - long int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - unsigned long int st_dev; - long int st_pad1[3]; - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ - /* - * Actually this should be timestruc_t st_atime, st_mtime and - * st_ctime but we don't have it under Linux. - */ - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; - __blksize_t st_blksize; /* Optimal block size for I/O. */ - long int st_pad3; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ - long int st_pad4[14]; - }; -#endif -#else -struct stat - { - __dev_t st_dev; - int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; -#else - __ino64_t st_ino; -#endif - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 - unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ - __off_t st_size; - int st_pad3; -#else - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -#endif - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; - __blksize_t st_blksize; - unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; -#else - __blkcnt64_t st_blocks; -#endif - int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; - unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ - __ino64_t st_ino; - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; - __blksize_t st_blksize; - unsigned int st_pad3; - __blkcnt64_t st_blocks; - int st_pad4[14]; -}; -#endif -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* POSIX.1b objects. Note that these macros always evaluate to zero. But - they do it by enforcing the correct use of the macros. */ -#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h deleted file mode 100644 index 2f9bd54edc..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/statfs.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 1997, 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 _SYS_STATFS_H -# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." -#endif - -#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ - -struct statfs - { - long int f_type; -#define f_fstyp f_type - long int f_bsize; - long int f_frsize; /* Fragment size - unsupported */ -#ifndef __USE_FILE_OFFSET64 - __fsblkcnt_t f_blocks; - __fsblkcnt_t f_bfree; - __fsblkcnt_t f_files; - __fsblkcnt_t f_ffree; - __fsblkcnt_t f_bavail; -#else - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_files; - __fsblkcnt64_t f_ffree; - __fsblkcnt64_t f_bavail; -#endif - - /* Linux specials */ - __fsid_t f_fsid; - long int f_namelen; - long int f_spare[6]; - }; - -#ifdef __USE_LARGEFILE64 -struct statfs64 - { - long int f_type; -#define f_fstyp f_type - long int f_bsize; - long int f_frsize; /* Fragment size - unsupported */ - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_files; - __fsblkcnt64_t f_ffree; - __fsblkcnt64_t f_bavail; - - /* Linux specials */ - __fsid_t f_fsid; - long int f_namelen; - long int f_spare[6]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATFS_F_NAMELEN diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h deleted file mode 100644 index 4ff6e37ad6..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ /dev/null @@ -1,218 +0,0 @@ -/* termios type and macro definitions. Linux/MIPS version. - Copyright (C) 1993, 94, 95, 96, 97, 99 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 _TERMIOS_H -# error "Never include <bits/termios.h> directly; use <termios.h> instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 32 -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 */ - }; - -/* c_cc characters */ -#define VINTR 0 /* Interrupt character [ISIG]. */ -#define VQUIT 1 /* Quit character [ISIG]. */ -#define VERASE 2 /* Erase character [ICANON]. */ -#define VKILL 3 /* Kill-line character [ICANON]. */ -#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ -#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ -#define VEOL2 6 /* Second EOL character [ICANON]. */ -#define VSWTC 7 -#define VSWTCH VSWTC -#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ -#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ -#define VSUSP 10 /* Suspend character [ISIG]. */ - /* VDSUSP is not supported on Linux. */ -/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ -#define VREPRINT 12 /* Reprint-line character [ICANON]. */ -#define VDISCARD 13 /* Discard character [IEXTEN]. */ -#define VWERASE 14 /* Word-erase character [ICANON]. */ -#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ -#define VEOF 16 /* End-of-file character [ICANON]. */ -#define VEOL 17 /* End-of-line character [ICANON]. */ - -/* c_iflag bits */ -#define IGNBRK 0000001 /* Ignore break condition. */ -#define BRKINT 0000002 /* Signal interrupt on break. */ -#define IGNPAR 0000004 /* Ignore characters with parity errors. */ -#define PARMRK 0000010 /* Mark parity and framing errors. */ -#define INPCK 0000020 /* Enable input parity check. */ -#define ISTRIP 0000040 /* Strip 8th bit off characters. */ -#define INLCR 0000100 /* Map NL to CR on input. */ -#define IGNCR 0000200 /* Ignore CR. */ -#define ICRNL 0000400 /* Map CR to NL on input. */ -#define IUCLC 0001000 /* Map upper case to lower case on input. */ -#define IXON 0002000 /* Enable start/stop output control. */ -#define IXANY 0004000 /* Any character will restart after stop. */ -#define IXOFF 0010000 /* Enable start/stop input control. */ -#define IMAXBEL 0020000 /* Ring bell when input queue is full. */ -#define IUTF8 0040000 /* Input is UTF8. */ - -/* c_oflag bits */ -#define OPOST 0000001 /* Perform output processing. */ -#define OLCUC 0000002 /* Map lower case to upper case on output. */ -#define ONLCR 0000004 /* Map NL to CR-NL on output. */ -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0000400 -# define NL0 0000000 -# define NL1 0000400 -# define CRDLY 0003000 -# define CR0 0000000 -# define CR1 0001000 -# define CR2 0002000 -# define CR3 0003000 -# define TABDLY 0014000 -# define TAB0 0000000 -# define TAB1 0004000 -# define TAB2 0010000 -# define TAB3 0014000 -# define BSDLY 0020000 -# define BS0 0000000 -# define BS1 0020000 -# define FFDLY 0100000 -# define FF0 0000000 -# define FF1 0100000 -#endif - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#ifdef __USE_MISC -# define XTABS 0014000 -#endif - -/* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0010017 -#endif -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#define CSIZE 0000060 /* Number of bits per byte (mask). */ -#define CS5 0000000 /* 5 bits per byte. */ -#define CS6 0000020 /* 6 bits per byte. */ -#define CS7 0000040 /* 7 bits per byte. */ -#define CS8 0000060 /* 8 bits per byte. */ -#define CSTOPB 0000100 /* Two stop bits instead of one. */ -#define CREAD 0000200 /* Enable receiver. */ -#define PARENB 0000400 /* Parity enable. */ -#define PARODD 0001000 /* Odd parity instead of even. */ -#define HUPCL 0002000 /* Hang up on last close. */ -#define CLOCAL 0004000 /* Ignore modem status lines. */ -#ifdef __USE_MISC -# define CBAUDEX 0010000 -#endif -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 -#ifdef __USE_MISC -# define CIBAUD 002003600000 /* input baud rate (not used) */ -# define CRTSCTS 020000000000 /* flow control */ -#endif - -/* c_lflag bits */ -#define ISIG 0000001 /* Enable signals. */ -#define ICANON 0000002 /* Do erase and kill processing. */ -#if defined __USE_MISC || defined __USE_XOPEN -# define XCASE 0000004 -#endif -#define ECHO 0000010 /* Enable echo. */ -#define ECHOE 0000020 /* Visual erase for ERASE. */ -#define ECHOK 0000040 /* Echo NL after KILL. */ -#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ -#define NOFLSH 0000200 /* Disable flush after interrupt. */ -#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ -#ifdef __USE_MISC -# define ECHOCTL 0001000 /* Echo control characters as ^X. */ -# define ECHOPRT 0002000 /* Hardcopy visual erase. */ -# define ECHOKE 0004000 /* Visual erase for KILL. */ -# define FLUSHO 0020000 -# define PENDIN 0040000 /* Retype pending input (state). */ -#endif -#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ -#define ITOSTOP TOSTOP - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 /* Suspend output. */ -#define TCOON 1 /* Restart suspended output. */ -#define TCIOFF 2 /* Send a STOP character. */ -#define TCION 3 /* Send a START character. */ - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 /* Discard data received but not yet read. */ -#define TCOFLUSH 1 /* Discard data written but not yet sent. */ -#define TCIOFLUSH 2 /* Discard all pending data. */ - -/* tcsetattr uses these */ -#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ -#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ -#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c deleted file mode 100644 index 00056bee7a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/brk.c +++ /dev/null @@ -1,57 +0,0 @@ -/* brk system call for Linux/MIPS. - Copyright (C) 2000, 2005, 2006 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 <errno.h> -#include <unistd.h> -#include <sysdep.h> - -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - { - register long int res __asm__ ("$2"); - - asm ("move\t$4,%2\n\t" - "li\t%0,%1\n\t" - "syscall" /* Perform the system call. */ - : "=r" (res) - : "I" (SYS_ify (brk)), "r" (addr) - : "$4", "$7", __SYSCALL_CLOBBERS); - newbrk = (void *) res; - } - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S deleted file mode 100644 index f521df1771..0000000000 --- a/sysdeps/unix/sysv/linux/mips/clone.S +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@linux-mips.org>, 1996. - - 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. */ - -/* clone() is even more special than fork() as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <sys/asm.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#ifdef RESET_PID -#include <tls.h> -#endif - -#define CLONE_VM 0x00000100 -#define CLONE_THREAD 0x00010000 - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, - void *parent_tidptr, void *tls, void *child_tidptr) */ - - .text -#if _MIPS_SIM == _ABIO32 -# define EXTRA_LOCALS 1 -#else -# define EXTRA_LOCALS 0 -#endif -LOCALSZ= 4 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -GPOFF= FRAMESZ-(1*SZREG) -NESTED(__clone,4*SZREG,sp) -#ifdef __PIC__ - SETUP_GP -#endif - PTR_SUBU sp, FRAMESZ - SETUP_GP64 (GPOFF, __clone) -#ifdef __PIC__ - SAVE_GP (GPOFF) -#endif -#ifdef PROF - .set noat - move $1,ra - jal _mcount - .set at -#endif - - - /* Sanity check arguments. */ - li v0,EINVAL - beqz a0,L(error) /* No NULL function pointers. */ - beqz a1,L(error) /* No NULL stack pointers. */ - - PTR_SUBU a1,32 /* Reserve argument save space. */ - PTR_S a0,0(a1) /* Save function pointer. */ - PTR_S a3,PTRSIZE(a1) /* Save argument pointer. */ -#ifdef RESET_PID - LONG_S a2,(PTRSIZE*2)(a1) /* Save clone flags. */ -#endif - - move a0,a2 - - /* Shuffle in the last three arguments - arguments 5, 6, and 7 to - this function, but arguments 3, 4, and 5 to the syscall. */ -#if _MIPS_SIM == _ABIO32 - PTR_L a2,(FRAMESZ+PTRSIZE+PTRSIZE+16)(sp) - PTR_S a2,16(sp) - PTR_L a2,(FRAMESZ+16)(sp) - PTR_L a3,(FRAMESZ+PTRSIZE+16)(sp) -#else - move a2,a4 - move a3,a5 - move a4,a6 -#endif - - /* Do the system call */ - li v0,__NR_clone - syscall - - bnez a3,L(error) - beqz v0,L(thread_start) - - /* Successful return from the parent */ - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - ret - - /* Something bad happened -- no child created */ -L(error): -#ifdef __PIC__ - PTR_LA t9,__syscall_error - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - jr t9 -#else - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - j __syscall_error -#endif - END(__clone) - -/* Load up the arguments to the function. Put this block of code in - its own function so that we can terminate the stack trace with our - debug info. */ - -ENTRY(__thread_start) -L(thread_start): - /* cp is already loaded. */ - SAVE_GP (GPOFF) - /* The stackframe has been created on entry of clone(). */ - -#ifdef RESET_PID - /* Check and see if we need to reset the PID. */ - LONG_L a0,(PTRSIZE*2)(sp) - and a1,a0,CLONE_THREAD - beqz a1,L(restore_pid) -L(donepid): -#endif - - /* Restore the arg for user's function. */ - PTR_L t9,0(sp) /* Function pointer. */ - PTR_L a0,PTRSIZE(sp) /* Argument pointer. */ - - /* Call the user's function. */ - jal t9 - - /* Call _exit rather than doing it inline for breakpoint purposes. */ - move a0,v0 -#ifdef __PIC__ - PTR_LA t9,_exit - jalr t9 -#else - jal _exit -#endif - -#ifdef RESET_PID -L(restore_pid): - and a1,a0,CLONE_VM - li v0,-1 - bnez a1,L(gotpid) - li v0,__NR_getpid - syscall -L(gotpid): - READ_THREAD_POINTER(v1) - INT_S v0,PID_OFFSET(v1) - INT_S v0,TID_OFFSET(v1) - b L(donepid) -#endif - - END(__thread_start) - -weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure deleted file mode 100755 index 4d9568f001..0000000000 --- a/sysdeps/unix/sysv/linux/mips/configure +++ /dev/null @@ -1,78 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/unix/sysv/linux/mips. - -case $machine in -mips*64*) - rm -f asm-unistd.h - asm_unistd_h=$sysheaders/asm/unistd.h - if test ! -f $asm_unistd_h; then - # Try to find asm/unistd.h in compiler header search path. - try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - | - sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'` - if test -n "$try_asm_unistd_h" && - test -f "$try_asm_unistd_h"; then - asm_unistd_h=$try_asm_unistd_h - fi - fi - if test ! -f "$asm_unistd_h"; then - { echo "$as_me:$LINENO: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&5 -echo "$as_me: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&2;} - echo '#include <asm/unistd.h>' > asm-unistd.h - elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then - # The point of this preprocessing is to turn __NR_<syscall> into - # __NR_N64_<syscall>, as well as to define __NR_<syscall> to - # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined - # and <abi> is the compiler-enabled ABI. - cat "$asm_unistd_h" | - sed -e 's,__NR_,__NR_N64_,g' \ - -e 's,__NR_N64_##,__NR_##,g' \ - -e 's,__NR_N64_O32_,__NR_O32_,g' \ - -e 's,__NR_N64_N32_,__NR_N32_,g' \ - -e 's,__NR_N64_N64_,__NR_N64_,g' \ - | awk > asm-unistd.h ' -BEGIN { print "#include <sgidefs.h>"; } -/^#define __NR.*unused/ { print; next; } -/^#define __NR_N64__exit __NR_N64_exit/ { - print "#define __NR__exit __NR_exit"; - print "#define __NR_O32__exit __NR_O32_exit"; - print "#define __NR_N32__exit __NR_N32_exit"; - print; next; -} -/^#define __NR_O32_/ { - name = $2; - sub (/_O32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIO32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N32_/ { - name = $2; - sub (/_N32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIN32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N64_/ { - name = $2; - sub (/_N64_/, "_", name); - print; - print "#if _MIPS_SIM == _ABI64"; - print "# define " name " " $2; - print "#endif"; - next; -} -{ - print; -}' - else - echo '#include <asm/unistd.h>' > asm-unistd.h - fi ;; -mips*) - rm -f asm-unistd.h - echo '#include <asm/unistd.h>' > asm-unistd.h - ;; -esac diff --git a/sysdeps/unix/sysv/linux/mips/configure.in b/sysdeps/unix/sysv/linux/mips/configure.in deleted file mode 100644 index e2e5d16c55..0000000000 --- a/sysdeps/unix/sysv/linux/mips/configure.in +++ /dev/null @@ -1,78 +0,0 @@ -sinclude(./aclocal.m4)dnl Autoconf lossage -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/unix/sysv/linux/mips. - -case $machine in -mips*64*) - rm -f asm-unistd.h - asm_unistd_h=$sysheaders/asm/unistd.h - if test ! -f $asm_unistd_h; then - # Try to find asm/unistd.h in compiler header search path. - try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - | - sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'` - if test -n "$try_asm_unistd_h" && - test -f "$try_asm_unistd_h"; then - asm_unistd_h=$try_asm_unistd_h - fi - fi - if test ! -f "$asm_unistd_h"; then - AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed]) - echo '#include <asm/unistd.h>' > asm-unistd.h - elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then - # The point of this preprocessing is to turn __NR_<syscall> into - # __NR_N64_<syscall>, as well as to define __NR_<syscall> to - # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined - # and <abi> is the compiler-enabled ABI. - cat "$asm_unistd_h" | - sed -e 's,__NR_,__NR_N64_,g' \ - -e 's,__NR_N64_##,__NR_##,g' \ - -e 's,__NR_N64_O32_,__NR_O32_,g' \ - -e 's,__NR_N64_N32_,__NR_N32_,g' \ - -e 's,__NR_N64_N64_,__NR_N64_,g' \ - | awk > asm-unistd.h ' -BEGIN { print "#include <sgidefs.h>"; } -/^#define __NR.*unused/ { print; next; } -/^#define __NR_N64__exit __NR_N64_exit/ { - print "#define __NR__exit __NR_exit"; - print "#define __NR_O32__exit __NR_O32_exit"; - print "#define __NR_N32__exit __NR_N32_exit"; - print; next; -} -/^#define __NR_O32_/ { - name = $2; - sub (/_O32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIO32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N32_/ { - name = $2; - sub (/_N32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIN32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N64_/ { - name = $2; - sub (/_N64_/, "_", name); - print; - print "#if _MIPS_SIM == _ABI64"; - print "# define " name " " $2; - print "#endif"; - next; -} -{ - print; -}' - else - echo '#include <asm/unistd.h>' > asm-unistd.h - fi ;; -mips*) - rm -f asm-unistd.h - echo '#include <asm/unistd.h>' > asm-unistd.h - ;; -esac diff --git a/sysdeps/unix/sysv/linux/mips/dl-cache.h b/sysdeps/unix/sysv/linux/mips/dl-cache.h deleted file mode 100644 index 4fa5d3ad22..0000000000 --- a/sysdeps/unix/sysv/linux/mips/dl-cache.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Support for reading /etc/ld.so.cache files written by Linux ldconfig. - Copyright (C) 2003 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 add_system_dir(dir) \ - do \ - { \ - size_t len = strlen (dir); \ - char path[len + 3]; \ - memcpy (path, dir, len + 1); \ - if (len >= 6 \ - && (! memcmp (path + len - 6, "/lib64", 6) \ - || ! memcmp (path + len - 6, "/lib32", 6))) \ - { \ - len -= 2; \ - path[len] = '\0'; \ - } \ - add_dir (path); \ - if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ - { \ - memcpy (path + len, "32", 3); \ - add_dir (path); \ - memcpy (path + len, "64", 3); \ - add_dir (path); \ - } \ - } while (0) - -#include_next <dl-cache.h> diff --git a/sysdeps/unix/sysv/linux/mips/entry.h b/sysdeps/unix/sysv/linux/mips/entry.h deleted file mode 100644 index 04d05d2b0a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/entry.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __ASSEMBLY__ -extern void __start (void); -#endif - -#define ENTRY_POINT __start diff --git a/sysdeps/unix/sysv/linux/mips/fcntl.c b/sysdeps/unix/sysv/linux/mips/fcntl.c deleted file mode 100644 index ea951bc4f9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/fcntl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/sysdeps/unix/sysv/linux/mips/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/ftruncate64.c deleted file mode 100644 index a46e22f828..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ftruncate64.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005,2006 - 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 <sys/types.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <kernel-features.h> - -#ifdef __NR_ftruncate64 -#ifndef __ASSUME_TRUNCATE64_SYSCALL -/* The variable is shared between all wrappers around *truncate64 calls. */ -extern int __have_no_truncate64; -#endif - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -__ftruncate64 (int fd, off64_t length) -{ -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (! __have_no_truncate64) -#endif - { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; -#ifndef __ASSUME_TRUNCATE64_SYSCALL - int saved_errno = errno; -#endif - int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0, - __LONG_LONG_PAIR (high, low)); -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (result != -1 || errno != ENOSYS) -#endif - return result; - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - __set_errno (saved_errno); - __have_no_truncate64 = 1; -#endif - } - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if ((off_t) length != length) - { - __set_errno (EINVAL); - return -1; - } - return __ftruncate (fd, (off_t) length); -#endif -} -weak_alias (__ftruncate64, ftruncate64) - -#else -/* Use the generic implementation. */ -# include <misc/ftruncate64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/getmsg.c b/sysdeps/unix/sysv/linux/mips/getmsg.c deleted file mode 100644 index 3a1fa08525..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/sysdeps/unix/sysv/linux/mips/getpagesize.c b/sysdeps/unix/sysv/linux/mips/getpagesize.c deleted file mode 100644 index 49492e5137..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getpagesize.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/ia64/getpagesize.c> diff --git a/sysdeps/unix/sysv/linux/mips/getsysstats.c b/sysdeps/unix/sysv/linux/mips/getsysstats.c deleted file mode 100644 index 9b521ac76a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getsysstats.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Determine various system internal values, Linux/MIPS version. - Copyright (C) 2001 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. */ - - -/* We need to define a special parser for /proc/cpuinfo. */ -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ - do \ - { \ - (RESULT) = 0; \ - /* Read all lines and count the lines starting with the string \ - "cpu model". We don't have to fear extremely long lines since \ - the kernel will not generate them. 8192 bytes are really \ - enough. */ \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ - if (strncmp (BUFFER, "cpu model", 9) == 0) \ - ++(RESULT); \ - } \ - while (0) - -#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/sysdeps/unix/sysv/linux/mips/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/ipc_priv.h deleted file mode 100644 index 9b85386a7c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ipc_priv.h +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/alpha/ipc_priv.h> diff --git a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h b/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h deleted file mode 100644 index b6f52cc9c9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h +++ /dev/null @@ -1,40 +0,0 @@ -/* This is the sigaction structure from the Linux 2.1.24 kernel. */ - -#include <sgidefs.h> - -#define HAVE_SA_RESTORER - -struct old_kernel_sigaction { - unsigned int sa_flags; - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned int __pad0[3]; /* reserved, keep size constant */ - - /* Abi says here follows reserved int[2] */ - void (*sa_restorer)(void); -#if (_MIPS_SZPTR < 64) - /* - * For 32 bit code we have to pad struct sigaction to get - * constant size for the ABI - */ - int pad1[1]; /* reserved */ -#endif -}; - - -#define _KERNEL_NSIG 128 -#define _KERNEL_NSIG_BPW _MIPS_SZLONG -#define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW) - -typedef struct { - unsigned long sig[_KERNEL_NSIG_WORDS]; -} kernel_sigset_t; - -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - unsigned int sa_flags; - __sighandler_t k_sa_handler; - kernel_sigset_t sa_mask; - void (*sa_restorer)(void); - int s_resv[1]; /* reserved */ -}; diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h deleted file mode 100644 index cab1e7110e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h +++ /dev/null @@ -1,57 +0,0 @@ -#include <sgidefs.h> -/* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the - userland data structures are not identical, because of different - padding. */ -/* Definition of `struct stat' used in the kernel. */ -#if _MIPS_SIM != _ABIO32 -struct kernel_stat - { - unsigned int st_dev; - unsigned int __pad1[3]; - unsigned long long st_ino; - unsigned int st_mode; - unsigned int st_nlink; - int st_uid; - int st_gid; - unsigned int st_rdev; - unsigned int __pad2[3]; - long long st_size; - unsigned int st_atime; - unsigned int __unused1; - unsigned int st_mtime; - unsigned int __unused2; - unsigned int st_ctime; - unsigned int __unused3; - unsigned int st_blksize; - unsigned int __pad3; - unsigned long long st_blocks; - }; -#else -struct kernel_stat - { - unsigned long int st_dev; - long int __pad1[3]; /* Reserved for network id */ - unsigned long int st_ino; - unsigned long int st_mode; - unsigned long int st_nlink; - long int st_uid; - long int st_gid; - unsigned long int st_rdev; - long int __pad2[2]; - long int st_size; - long int __pad3; - long int st_atime; - long int __unused1; - long int st_mtime; - long int __unused2; - long int st_ctime; - long int __unused3; - long int st_blksize; - long int st_blocks; - char st_fstype[16]; /* Filesystem type name, unsupported */ - long st_pad4[8]; - /* Linux specific fields */ - unsigned int st_flags; - unsigned int st_gen; - }; -#endif diff --git a/sysdeps/unix/sysv/linux/mips/kernel_termios.h b/sysdeps/unix/sysv/linux/mips/kernel_termios.h deleted file mode 100644 index 9b622f4d1f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_termios.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 1997 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 _KERNEL_TERMIOS_H -#define _KERNEL_TERMIOS_H 1 -/* The following corresponds to the values from the Linux 2.1.24 kernel. */ - -#define __KERNEL_NCCS 23 - -struct __kernel_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[__KERNEL_NCCS]; /* control characters */ - }; - -#endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/mips/lockf64.c b/sysdeps/unix/sysv/linux/mips/lockf64.c deleted file mode 100644 index a88f5a784a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/lockf64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h deleted file mode 100644 index 3da2412259..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 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 _LINUX_MIPS_MIPS32_SYSDEP_H -#define _LINUX_MIPS_MIPS32_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips32/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \ - "i" (SYS_ify (name)), err, args) - -#undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - internal_syscall##nr (= number, , "r" (__v0), err, args) - -#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0), "r" (__a1) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -/* We need to use a frame pointer for the functions in which we - adjust $sp around the syscall, or debug information and unwind - information will be $sp relative and thus wrong during the syscall. As - of GCC 3.4.3, this is sufficient. */ -#define FORCE_FRAME_POINTER alloca (4) - -#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - "sw\t%7, 20($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5), "r" ((long)arg6) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - "sw\t%7, 20($29)\n\t" \ - "sw\t%8, 24($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" - -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/mips32/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h b/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h deleted file mode 100644 index d490fb95e2..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2001, 2002, 2003 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 <sysdeps/generic/ldconfig.h> - -#define SYSDEP_KNOWN_INTERPRETER_NAMES \ - { "/lib32/ld.so.1", FLAG_ELF_LIBC6 }, \ - { "/lib64/ld.so.1", FLAG_ELF_LIBC6 }, -#define SYSDEP_KNOWN_LIBRARY_NAMES \ - { "libc.so.6", FLAG_ELF_LIBC6 }, \ - { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed deleted file mode 100644 index 2c327327e0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed +++ /dev/null @@ -1 +0,0 @@ -s_^\(RTLDLIST=\)\(.*lib\)\(\|32\|64\)\(/[^/]*\.so\.[0-9.]*\)[ ]*$_\1"\232\4 \264\4 \2\4"_ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c b/sysdeps/unix/sysv/linux/mips/mips64/llseek.c deleted file mode 100644 index 24013a8224..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c +++ /dev/null @@ -1 +0,0 @@ -/* lseek() is 64-bit capable already. */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c deleted file mode 100644 index 42efcba315..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2003 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 <sys/types.h> - -#include <sysdep.h> - -extern int ftruncate (int fd, off64_t length); - -int __ftruncate64 (int fd, off64_t length) { - return ftruncate (fd, length); -} -weak_alias (__ftruncate64, ftruncate64) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h deleted file mode 100644 index e6013669a4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h +++ /dev/null @@ -1,242 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 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 _LINUX_MIPS_SYSDEP_H -#define _LINUX_MIPS_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips64/n32/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args) - -#define internal_syscall0(name, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %2\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(name, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %3\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(name, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %4\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(name, err, arg1, arg2, arg3) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - register long long __a4 asm("$8") = (long long) arg5; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - register long long __a4 asm("$8") = (long long) arg5; \ - register long long __a5 asm("$9") = (long long) arg6; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4), "r" (__a5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c deleted file mode 100644 index 339023f14f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2003 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 <sys/types.h> - -#include <sysdep.h> -#include <bp-checks.h> - -extern int truncate (const char *__unbounded path, int dummy, - off64_t length); - -int truncate64 (const char *__unbounded path, int dummy, - off64_t length) { - return truncate (path, dummy, length); -} diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c deleted file mode 100644 index 33918ea6a5..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c +++ /dev/null @@ -1 +0,0 @@ -/* glob64 is in glob.c */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S deleted file mode 100644 index e4b4f00a8c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2003, 2005 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 <sysdep.h> - -#include <sys/asm.h> - -/* Sign-extend the ioctl number, since the kernel wants it as a - sign-extended 32-bit value, but our prototype is that of a long. */ - - .text -ENTRY (__ioctl) - sll a1, a1, 0 - li v0, __NR_ioctl - syscall /* Do the system call. */ - bne a3, zero, L(error) - ret - -L(error): - SETUP_GP64 (a0, __ioctl) - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 - -PSEUDO_END (__ioctl) - -weak_alias (__ioctl, ioctl) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h deleted file mode 100644 index dc0a1a0edc..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h +++ /dev/null @@ -1,242 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 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 _LINUX_MIPS_SYSDEP_H -#define _LINUX_MIPS_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips64/n64/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args) - -#define internal_syscall0(name, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %2\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(name, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %3\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(name, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %4\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(name, err, arg1, arg2, arg3) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - register long __a4 asm("$8") = (long) arg5; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - register long __a4 asm("$8") = (long) arg5; \ - register long __a5 asm("$9") = (long) arg6; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4), "r" (__a5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/recv.c b/sysdeps/unix/sysv/linux/mips/mips64/recv.c deleted file mode 100644 index b910525c92..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/recv.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/x86_64/recv.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/send.c b/sysdeps/unix/sysv/linux/mips/mips64/send.c deleted file mode 100644 index d2c2996a21..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/send.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/x86_64/send.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S deleted file mode 100644 index 3c6aaac810..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2001, 2002, 2003, 2005 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 <sysdep.h> - -#include <sys/asm.h> - -/* Usage: - long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6, arg7) - - We need to do some arg shifting, syscall_number will be in v0. */ - - - .text -NESTED (syscall, SZREG, ra) - .mask 0x00010000, -SZREG - .fmask 0x00000000, 0 - PTR_ADDIU sp, -SZREG - REG_S s0, (sp) - - move s0, a0 - move a0, a1 /* shift arg1 - arg7. */ - move a1, a2 - move a2, a3 - move a3, a4 - move a4, a5 - move a5, a6 - move a6, a7 - - move v0, s0 /* Syscall number -> v0 */ - syscall /* Do the system call. */ - - REG_L s0, (sp) - PTR_ADDIU sp, SZREG - bne a3, zero, L(error) - - ret - -L(error): - SETUP_GP64 (a0, syscall) - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 - -END (syscall) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list deleted file mode 100644 index b0d79ff6a4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ /dev/null @@ -1,21 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64 - -# proper socket implementations: -recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom -sendto - sendto i:ibnibn __libc_sendto __sendto sendto - -# semaphore and shm system calls -msgctl - msgctl i:iip __msgctl msgctl -msgget - msgget i:ii __msgget msgget -msgrcv - msgrcv i:ibnii __msgrcv msgrcv -msgsnd - msgsnd i:ibni __msgsnd msgsnd -shmat - shmat i:ipi __shmat shmat -shmctl - shmctl i:iip __shmctl shmctl -shmdt - shmdt i:s __shmdt shmdt -shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop -semtimedop - semtimedop i:ipip semtimedop -semget - semget i:iii __semget semget -semctl - semctl i:iiii __semctl semctl diff --git a/sysdeps/unix/sysv/linux/mips/mips64/umount.c b/sysdeps/unix/sysv/linux/mips/mips64/umount.c deleted file mode 100644 index 9a91ba5b2f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/umount.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/hppa/umount.c> diff --git a/sysdeps/unix/sysv/linux/mips/pipe.S b/sysdeps/unix/sysv/linux/mips/pipe.S deleted file mode 100644 index 1708888da4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/mips/pipe.S> diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c deleted file mode 100644 index eff7d473d0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pread.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - 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 <assert.h> -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pread -# error "__NR_pread and __NR_pread64 both defined???" -# endif -# define __NR_pread __NR_pread64 -#endif - -#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 - -# if __ASSUME_PREAD_SYSCALL == 0 -static ssize_t __emulate_pread (int fd, void *buf, size_t count, - off_t offset) internal_function; -# endif - -ssize_t -__libc_pread (fd, buf, count, offset) - int fd; - void *buf; - size_t count; - off_t offset; -{ - ssize_t result; - -#if _MIPS_SIM != _ABI64 - assert (sizeof (offset) == 4); -#endif - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -strong_alias (__libc_pread, __pread) -weak_alias (__libc_pread, pread) - -# define __libc_pread(fd, buf, count, offset) \ - static internal_function __emulate_pread (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include <sysdeps/posix/pread.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c deleted file mode 100644 index d8763acabb..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pread64.c +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - 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 <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pread -# error "__NR_pread and __NR_pread64 both defined???" -# endif -# define __NR_pread __NR_pread64 -#endif - -#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 - -# if __ASSUME_PREAD_SYSCALL == 0 -static ssize_t __emulate_pread64 (int fd, void *buf, size_t count, - off64_t offset) internal_function; -# endif - -ssize_t -__libc_pread64 (fd, buf, count, offset) - int fd; - void *buf; - size_t count; - off64_t offset; -{ - ssize_t result; - - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread64 (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread64 (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -weak_alias (__libc_pread64, __pread64) -weak_alias (__libc_pread64, pread64) - -# define __libc_pread64(fd, buf, count, offset) \ - static internal_function __emulate_pread64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include <sysdeps/posix/pread64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/profil-counter.h b/sysdeps/unix/sysv/linux/mips/profil-counter.h deleted file mode 100644 index 8a6a0bcf3d..0000000000 --- a/sysdeps/unix/sysv/linux/mips/profil-counter.h +++ /dev/null @@ -1,2 +0,0 @@ -/* We can use the ix86 version. */ -#include <sysdeps/unix/sysv/linux/i386/profil-counter.h> diff --git a/sysdeps/unix/sysv/linux/mips/ptrace.c b/sysdeps/unix/sysv/linux/mips/ptrace.c deleted file mode 100644 index 19d7c2d927..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ptrace.c +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004 - 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 <errno.h> -#include <sgidefs.h> -#include <sys/types.h> -#include <sys/ptrace.h> -#include <sys/user.h> -#include <stdarg.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> -#include <sgidefs.h> - -#if _MIPS_SIM == _ABIN32 -__extension__ typedef long long int reg_type; -#else -typedef long int reg_type; -#endif - -reg_type -ptrace (enum __ptrace_request request, ...) -{ - reg_type res, ret; - va_list ap; - pid_t pid; - void *addr; - reg_type data; - - va_start (ap, request); - pid = va_arg (ap, pid_t); - addr = va_arg (ap, void *); - data = va_arg (ap, reg_type); - va_end (ap); - - if (request > 0 && request < 4) - data = &ret; - -#if __BOUNDED_POINTERS__ - switch (request) - { - case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: - case PTRACE_PEEKUSER: - case PTRACE_POKETEXT: - case PTRACE_POKEDATA: - case PTRACE_POKEUSER: - (void) CHECK_1 ((int *) addr); - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETREGS: - case PTRACE_SETREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETFPREGS: - case PTRACE_SETFPREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETFPXREGS: - case PTRACE_SETFPXREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_TRACEME: - case PTRACE_CONT: - case PTRACE_KILL: - case PTRACE_SINGLESTEP: - case PTRACE_ATTACH: - case PTRACE_DETACH: - case PTRACE_SYSCALL: - /* Neither `data' nor `addr' needs any checks. */ - break; - }; -#endif - - res = INLINE_SYSCALL (ptrace, 4, request, pid, - __ptrvalue (addr), __ptrvalue (data)); - if (res >= 0 && request > 0 && request < 4) - { - __set_errno (0); - return ret; - } - - return res; -} diff --git a/sysdeps/unix/sysv/linux/mips/putmsg.c b/sysdeps/unix/sysv/linux/mips/putmsg.c deleted file mode 100644 index ebc1680ca7..0000000000 --- a/sysdeps/unix/sysv/linux/mips/putmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c deleted file mode 100644 index 4378ebc859..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pwrite.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - 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 <assert.h> -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pwrite -# error "__NR_pwrite and __NR_pwrite64 both defined???" -# endif -# define __NR_pwrite __NR_pwrite64 -#endif - -#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 - -# if __ASSUME_PWRITE_SYSCALL == 0 -static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count, - off_t offset) internal_function; -# endif - -ssize_t -__libc_pwrite (fd, buf, count, offset) - int fd; - const void *buf; - size_t count; - off_t offset; -{ - ssize_t result; - -#if _MIPS_SIM != _ABI64 - assert (sizeof (offset) == 4); -#endif - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -strong_alias (__libc_pwrite, __pwrite) -weak_alias (__libc_pwrite, pwrite) - -# define __libc_pwrite(fd, buf, count, offset) \ - static internal_function __emulate_pwrite (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include <sysdeps/posix/pwrite.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c deleted file mode 100644 index e5853e432e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pwrite64.c +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>, 1998. - - 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 <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pwrite -# error "__NR_pwrite and __NR_pwrite64 both defined???" -# endif -# define __NR_pwrite __NR_pwrite64 -#endif - -#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 - -# if __ASSUME_PWRITE_SYSCALL == 0 -static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count, - off64_t offset) internal_function; -# endif - -ssize_t -__libc_pwrite64 (fd, buf, count, offset) - int fd; - const void *buf; - size_t count; - off64_t offset; -{ - ssize_t result; - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite64 (fd, buf, count, offset); -# endif - - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite64 (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -weak_alias (__libc_pwrite64, __pwrite64) -libc_hidden_weak (__pwrite64) -weak_alias (__libc_pwrite64, pwrite64) - -# define __libc_pwrite64(fd, buf, count, offset) \ - static internal_function __emulate_pwrite64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include <sysdeps/posix/pwrite64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c deleted file mode 100644 index baa92fe57c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/readelflib.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 1999, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - Based on work ../x86_64/readelflib.c, - contributed by Andreas Jaeger <aj@suse.de>, 1999 and - Jakub Jelinek <jakub@redhat.com>, 1999. - - 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. */ - - -int process_elf32_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, - void *file_contents, size_t file_length); -int process_elf64_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, - void *file_contents, size_t file_length); - -/* Returns 0 if everything is ok, != 0 in case of error. */ -int -process_elf_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, void *file_contents, - size_t file_length) -{ - ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; - int ret; - - if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - { - ret = process_elf32_file (file_name, lib, flag, osversion, soname, - file_contents, file_length); - - /* n32 libraries are always libc.so.6+. */ - if (ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0) - *flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6; - } - else - { - ret = process_elf64_file (file_name, lib, flag, osversion, soname, - file_contents, file_length); - /* n64 libraries are always libc.so.6+. */ - if (!ret) - *flag = FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6; - } - - return ret; -} - -#undef __ELF_NATIVE_CLASS -#undef process_elf_file -#define process_elf_file process_elf32_file -#define __ELF_NATIVE_CLASS 32 -#include "elf/readelflib.c" - -#undef __ELF_NATIVE_CLASS -#undef process_elf_file -#define process_elf_file process_elf64_file -#define __ELF_NATIVE_CLASS 64 -#include "elf/readelflib.c" diff --git a/sysdeps/unix/sysv/linux/mips/register-dump.h b/sysdeps/unix/sysv/linux/mips/register-dump.h deleted file mode 100644 index f5bd3a2735..0000000000 --- a/sysdeps/unix/sysv/linux/mips/register-dump.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Dump registers. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <sys/uio.h> -#include <stdio-common/_itoa.h> - -/* We will print the register dump in this format: - - R0 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R8 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R16 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R24 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - pc cause status badvaddr lo hi - XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - The FPU registers will not be printed. -*/ - -static void -hexvalue (unsigned long int value, char *buf, size_t len) -{ - char *cp = _itoa_word (value, buf + len, 16, 0); - while (cp > buf) - *--cp = '0'; -} - -static void -register_dump (int fd, struct sigcontext *ctx) -{ - char regs[38][8]; - struct iovec iov[38 * 2 + 10]; - size_t nr = 0; - int i; - -#define ADD_STRING(str) \ - iov[nr].iov_base = (char *) str; \ - iov[nr].iov_len = strlen (str); \ - ++nr -#define ADD_MEM(str, len) \ - iov[nr].iov_base = str; \ - iov[nr].iov_len = len; \ - ++nr - - /* Generate strings of register contents. */ - for (i = 0; i < 32; i++) - hexvalue (ctx->sc_regs[i], regs[i], 8); - hexvalue (ctx->sc_pc, regs[32], 8); - hexvalue (ctx->sc_cause, regs[33], 8); - hexvalue (ctx->sc_status, regs[34], 8); - hexvalue (ctx->sc_badvaddr, regs[35], 8); - hexvalue (ctx->sc_mdhi, regs[36], 8); - hexvalue (ctx->sc_mdlo, regs[37], 8); - - /* Generate the output. */ - ADD_STRING ("Register dump:\n\n R0 "); - for (i = 0; i < 8; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R8 "); - for (i = 8; i < 16; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R16 "); - for (i = 16; i < 24; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R24 "); - for (i = 24; i < 32; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n pc cause status badvaddr lo hi\n "); - for (i = 32; i < 38; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n"); - - /* Write the stuff out. */ - writev (fd, iov, nr); -} - - -#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/sysdeps/unix/sysv/linux/mips/sigaction.c b/sysdeps/unix/sysv/linux/mips/sigaction.c deleted file mode 100644 index 8e2ca42bb4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sigaction.c +++ /dev/null @@ -1,188 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003,2004,2006 - 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 <errno.h> -#include <sgidefs.h> -#include <signal.h> -#include <string.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <sgidefs.h> - -#include <kernel-features.h> - -/* The difference here is that the sigaction structure used in the - kernel is not the same as we use in the libc. Therefore we must - translate it here. */ -#include <kernel_sigaction.h> - -#if __ASSUME_REALTIME_SIGNALS == 0 -/* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. This is the definition. */ -int __libc_missing_rt_sigs; - -#endif - -#if _MIPS_SIM != _ABIO32 - -# ifdef __NR_rt_sigreturn -static void restore_rt (void) asm ("__restore_rt"); -# endif -# ifdef __NR_sigreturn -static void restore (void) asm ("__restore"); -# endif -#endif - -/* If ACT is not NULL, change the action for SIG to *ACT. - If OACT is not NULL, put the old action for SIG in *OACT. */ -int -__libc_sigaction (sig, act, oact) - int sig; - const struct sigaction *act; - struct sigaction *oact; -{ -#if __ASSUME_REALTIME_SIGNALS == 0 - struct old_kernel_sigaction k_sigact, k_osigact; -#endif - int result; - -#if defined __NR_rt_sigaction || __ASSUME_REALTIME_SIGNALS > 0 - /* First try the RT signals. */ -# if __ASSUME_REALTIME_SIGNALS == 0 - if (!__libc_missing_rt_sigs) -# endif - { - struct kernel_sigaction kact, koact; - /* Save the current error value for later. We need not do this - if we are guaranteed to have realtime signals. */ -# if __ASSUME_REALTIME_SIGNALS == 0 - int saved_errno = errno; -# endif - - if (act) - { - kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t)); - kact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER -# if _MIPS_SIM == _ABIO32 - kact.sa_restorer = act->sa_restorer; -# else - kact.sa_restorer = &restore_rt; -# endif -# endif - } - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, - act ? __ptrvalue (&kact) : NULL, - oact ? __ptrvalue (&koact) : NULL, - sizeof (kernel_sigset_t)); - -# if __ASSUME_REALTIME_SIGNALS == 0 - if (result >= 0 || errno != ENOSYS) -# endif - { - if (oact && result >= 0) - { - oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, - sizeof (kernel_sigset_t)); - oact->sa_flags = koact.sa_flags; -# ifdef HAVE_SA_RESTORER - oact->sa_restorer = koact.sa_restorer; -# endif - } - return result; - } - -# if __ASSUME_REALTIME_SIGNALS == 0 - __set_errno (saved_errno); - __libc_missing_rt_sigs = 1; -# endif - } -#endif - -#if __ASSUME_REALTIME_SIGNALS == 0 - if (act) - { - k_sigact.k_sa_handler = act->sa_handler; - k_sigact.sa_mask = act->sa_mask.__val[0]; - k_sigact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER - k_sigact.sa_restorer = act->sa_restorer; -# endif - } - result = INLINE_SYSCALL (sigaction, 3, sig, - act ? __ptrvalue (&k_sigact) : NULL, - oact ? __ptrvalue (&k_osigact) : NULL); - if (oact && result >= 0) - { - oact->sa_handler = k_osigact.k_sa_handler; - oact->sa_mask.__val[0] = k_osigact.sa_mask; - oact->sa_flags = k_osigact.sa_flags; -# ifdef HAVE_SA_RESTORER -# if _MIPS_SIM == _ABIO32 - oact->sa_restorer = k_osigact.sa_restorer; -# else - oact->sa_restorer = &restore; -# endif -# endif - } - return result; -#endif -} -libc_hidden_def (__libc_sigaction) - -#ifndef LIBC_SIGACTION -weak_alias (__libc_sigaction, __sigaction) -libc_hidden_weak (__sigaction) -weak_alias (__libc_sigaction, sigaction) -#endif - -/* NOTE: Please think twice before making any changes to the bits of - code below. GDB needs some intimate knowledge about it to - recognize them as signal trampolines, and make backtraces through - signal handlers work right. Important are both the names - (__restore_rt) and the exact instruction sequence. - If you ever feel the need to make any changes, please notify the - appropriate GDB maintainer. */ - -#define RESTORE(name, syscall) RESTORE2 (name, syscall) -#define RESTORE2(name, syscall) \ -asm \ - ( \ - ".align 4\n" \ - "__" #name ":\n" \ - " li $2, " #syscall "\n" \ - " syscall\n" \ - ); - -/* The return code for realtime-signals. */ -#if _MIPS_SIM != _ABIO32 -# ifdef __NR_rt_sigreturn -RESTORE (restore_rt, __NR_rt_sigreturn) -# endif -# ifdef __NR_sigreturn -RESTORE (restore, __NR_sigreturn) -# endif -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h deleted file mode 100644 index f453c8d9b5..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - 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 <sgidefs.h> - -#if _MIPS_SIM == _ABIO32 - -#define SIGCONTEXT unsigned long _code, struct sigcontext * -#define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->sc_pc) -#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30]) -#define GET_STACK(ctx) ((void *) ctx->sc_regs[29]) -#define CALL_SIGHANDLER(handler, signo, ctx) \ - (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) - -#else - -#define SIGCONTEXT unsigned long _code, ucontext_t * -#define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc) -#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30]) -#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29]) -#define CALL_SIGHANDLER(handler, signo, ctx) \ - (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) - -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h deleted file mode 100644 index a93e1fb6d1..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 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 _SYS_CACHECTL_H -#define _SYS_CACHECTL_H 1 - -#include <features.h> - -/* - * Get the kernel definition for the op bits. - */ -#include <asm/cachectl.h> - -__BEGIN_DECLS - -#ifdef __USE_MISC -extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW; -#endif -extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW; -#ifdef __USE_MISC -extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW; -#endif -extern int _flush_cache (char *addr, __const int nbytes, __const int op) __THROW; - -__END_DECLS - -#endif /* sys/cachectl.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/procfs.h b/sysdeps/unix/sysv/linux/mips/sys/procfs.h deleted file mode 100644 index 2bf07be3e9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/procfs.h +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 - 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 _SYS_PROCFS_H -#define _SYS_PROCFS_H 1 - -/* This is somehow modelled after the file of the same name on SysVr4 - systems. It provides a definition of the core file format for ELF - used on Linux. */ - -#include <features.h> -#include <sgidefs.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/user.h> -#include <sgidefs.h> - -/* ELF register definitions */ -#define ELF_NGREG 45 -#define ELF_NFPREG 33 - -#if _MIPS_SIM == _ABIN32 -__extension__ typedef unsigned long long elf_greg_t; -#else -typedef unsigned long elf_greg_t; -#endif -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef double elf_fpreg_t; -typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; - -__BEGIN_DECLS - -struct elf_siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - }; - - -/* Definitions to generate Intel SVR4-like core files. These mostly - have the same names as the SVR4 types with "elf_" tacked on the - front to prevent clashes with linux definitions, and the typedef - forms have been avoided. This is mostly like the SVR4 structure, - but more Linuxy, with things that Linux does not support and which - gdb doesn't really use excluded. Fields present but not used are - marked with "XXX". */ -struct elf_prstatus - { - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ -#if _MIPS_SIM == _ABIN32 - __extension__ unsigned long long int pr_sigpend; - __extension__ unsigned long long int pr_sighold; -#else - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ -#endif - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ - elf_gregset_t pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -#define ELF_PRARGSZ (80) /* Number of chars for args */ - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ -#if _MIPS_SIM == _ABIN32 - __extension__ unsigned long long int pr_flag; -#else - unsigned long int pr_flag; /* Flags. */ -#endif - long pr_uid; - long 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. */ - }; - - -/* Addresses. */ -typedef void *psaddr_t; - -/* Register sets. Linux has different names. */ -typedef elf_gregset_t prgregset_t; -typedef elf_fpregset_t prfpregset_t; - -/* We don't have any differences between processes and threads, - therefore habe only ine PID type. */ -typedef __pid_t lwpid_t; - - -typedef struct elf_prstatus prstatus_t; -typedef struct elf_prpsinfo prpsinfo_t; - -__END_DECLS - -#endif /* sys/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/ptrace.h b/sysdeps/unix/sysv/linux/mips/sys/ptrace.h deleted file mode 100644 index d05853da77..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/ptrace.h +++ /dev/null @@ -1,136 +0,0 @@ -/* `ptrace' debugger support interface. Linux version. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 - 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 _SYS_PTRACE_H -#define _SYS_PTRACE_H 1 - -#include <features.h> -#include <sgidefs.h> - -__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. - This is not supported on all machines. */ - PTRACE_SINGLESTEP = 9, -#define PT_STEP PTRACE_SINGLESTEP - - /* 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 - - /* Attach to a process that is already running. */ - PTRACE_ATTACH = 16, -#define PT_ATTACH PTRACE_ATTACH - - /* Detach from a process attached to with PTRACE_ATTACH. */ - PTRACE_DETACH = 17, -#define PT_DETACH PTRACE_DETACH - - /* Get all extended floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_GETFPXREGS = 18, -#define PT_GETFPXREGS PTRACE_GETFPXREGS - - /* Set all extended floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_SETFPXREGS = 19, -#define PT_SETFPXREGS PTRACE_SETFPXREGS - - /* Continue and stop at the next (return from) syscall. */ - PTRACE_SYSCALL = 24 -#define PT_SYSCALL PTRACE_SYSCALL -}; - -/* Perform process tracing functions. REQUEST is one of the values - above, and determines the action to be taken. - For all requests except PTRACE_TRACEME, PID specifies the process to be - traced. - - PID and the other arguments described above for the various requests should - appear (those that are used for the particular request) as: - pid_t PID, void *ADDR, int DATA, void *ADDR2 - after REQUEST. */ -#if _MIPS_SIM == _ABIN32 -__extension__ extern long long int ptrace - (enum __ptrace_request __request, ...) __THROW; -#else -extern long int ptrace (enum __ptrace_request __request, ...) __THROW; -#endif - -__END_DECLS - -#endif /* _SYS_PTRACE_H */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/syscall.h b/sysdeps/unix/sysv/linux/mips/sys/syscall.h deleted file mode 100644 index f6458cd316..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/syscall.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 2003 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 _SYSCALL_H -#define _SYSCALL_H 1 - -/* This file should list the numbers of the system the system knows. - But instead of duplicating this we use the information available - from the kernel sources. */ -#ifdef _LIBC -/* Since the kernel doesn't define macro names in a way usable for - glibc, we preprocess this header, and use it during the glibc build - process. */ -# include <asm-unistd.h> -#else -# include <asm/unistd.h> -#endif - -#ifndef _LIBC -/* The Linux kernel header file defines macros `__NR_<name>', but some - programs expect the traditional form `SYS_<name>'. So in building libc - we scan the kernel's list and produce <bits/syscall.h> with macros for - all the `SYS_' names. */ -# include <bits/syscall.h> -#endif - -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h deleted file mode 100644 index 0677cafaa4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1995, 1997, 2000, 2001 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 _SYS_SYSMIPS_H -#define _SYS_SYSMIPS_H 1 - -#include <features.h> - -/* - * Commands for the sysmips(2) call - * - * sysmips(2) is deprecated - though some existing software uses it. - * We only support the following commands. Sysmips exists for compatibility - * purposes only so new software should avoid it. - */ -#define SETNAME 1 /* set hostname */ -#define FLUSH_CACHE 3 /* writeback and invalidate caches */ -#define MIPS_FIXADE 7 /* control address error fixing */ -#define MIPS_RDNVRAM 10 /* read NVRAM */ -#define MIPS_ATOMIC_SET 2001 /* atomically set variable */ - -__BEGIN_DECLS - -extern int sysmips (__const int cmd, ...) __THROW; - -__END_DECLS - -#endif /* sys/sysmips.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h deleted file mode 100644 index 1183b867b8..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/tas.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. - - 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 _SYS_TAS_H -#define _SYS_TAS_H 1 - -#include <features.h> -#include <sgidefs.h> - -__BEGIN_DECLS - -extern int _test_and_set (int *p, int v) __THROW; - -#ifdef __USE_EXTERN_INLINES - -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif - -_EXTERN_INLINE int -__NTH (_test_and_set (int *p, int v)) -{ - int r, t; - - __asm__ __volatile__ - ("/* Inline test and set */\n" - "1:\n\t" - ".set push\n\t" -#if _MIPS_SIM == _ABIO32 - ".set mips2\n\t" -#endif - "ll %0,%3\n\t" - "move %1,%4\n\t" - "beq %0,%4,2f\n\t" - "sc %1,%2\n\t" - ".set pop\n\t" - "beqz %1,1b\n" - "2:\n\t" - "/* End test and set */" - : "=&r" (r), "=&r" (t), "=m" (*p) - : "m" (*p), "r" (v) - : "memory"); - - return r; -} - -#endif /* __USE_EXTERN_INLINES */ - -__END_DECLS - -#endif /* sys/tas.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h deleted file mode 100644 index ddb499f20c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2003, 2004 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. */ - -/* Don't rely on this, the interface is currently messed up and may need to - be broken to be fixed. */ -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <sgidefs.h> -#include <signal.h> - -/* We need the signal context definitions even if they are not used - included in <signal.h>. */ -#include <bits/sigcontext.h> - -/* Type for general register. Even in o32 we assume 64-bit registers, - like the kernel. */ -__extension__ typedef unsigned long long int greg_t; - -/* Number of general registers. */ -#define NGREG 32 -#define NFPREG 32 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Container for all FPU registers. */ -typedef struct fpregset { - union { - double fp_dregs[NFPREG]; - struct { - float _fp_fregs; - unsigned int _fp_pad; - } fp_fregs[NFPREG]; - } fp_r; -} fpregset_t; - - -/* Context to describe whole processor state. */ -#if _MIPS_SIM == _ABIO32 -/* Earlier versions of glibc for mips had an entirely different - definition of mcontext_t, that didn't even resemble the - corresponding kernel data structure. Since all legitimate uses of - ucontext_t in glibc mustn't have accessed anything beyond - uc_mcontext and, even then, taking a pointer to it, casting it to - sigcontext_t, and accessing it as such, which is what it has always - been, this can still be rectified. Fortunately, makecontext, - [gs]etcontext et all have never been implemented. */ -typedef struct - { - unsigned int regmask; - unsigned int status; - greg_t pc; - gregset_t gregs; - fpregset_t fpregs; - unsigned int fp_owned; - unsigned int fpc_csr; - unsigned int fpc_eir; - unsigned int used_math; - unsigned int ssflags; - greg_t mdhi; - greg_t mdlo; - unsigned int cause; - unsigned int badvaddr; - } mcontext_t; -#else -typedef struct - { - gregset_t gregs; - fpregset_t fpregs; - greg_t mdhi; - greg_t mdlo; - greg_t pc; - unsigned int status; - unsigned int fpc_csr; - unsigned int fpc_eir; - unsigned int used_math; - unsigned int cause; - unsigned int badvaddr; - } mcontext_t; -#endif - -/* Userlevel context. */ -typedef struct ucontext - { - unsigned long int uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - __sigset_t uc_sigmask; - } ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/user.h b/sysdeps/unix/sysv/linux/mips/sys/user.h deleted file mode 100644 index d5b3b0508b..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/user.h +++ /dev/null @@ -1,219 +0,0 @@ -/* Copyright (C) 2002, 2003, 2004 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 _SYS_USER_H -#define _SYS_USER_H 1 - -#include <sgidefs.h> - -/* The whole purpose of this file is for GDB and GDB only. Don't read - too much into it. Don't use it for anything other than GDB unless - you know what you are doing. */ - -/* #include <asm/reg.h> */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste its - contents here. Note that the fact that the file is inline here, - instead of included separately, doesn't change in any way the - licensing status of a program that includes user.h. Since this is - for gdb alone, and gdb is GPLed, no surprises here. */ -#if _MIPS_SIM == _ABIO32 -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 by Ralf Baechle - */ -#ifndef __ASM_MIPS_REG_H -#define __ASM_MIPS_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 6 -#define EF_REG1 7 -#define EF_REG2 8 -#define EF_REG3 9 -#define EF_REG4 10 -#define EF_REG5 11 -#define EF_REG6 12 -#define EF_REG7 13 -#define EF_REG8 14 -#define EF_REG9 15 -#define EF_REG10 16 -#define EF_REG11 17 -#define EF_REG12 18 -#define EF_REG13 19 -#define EF_REG14 20 -#define EF_REG15 21 -#define EF_REG16 22 -#define EF_REG17 23 -#define EF_REG18 24 -#define EF_REG19 25 -#define EF_REG20 26 -#define EF_REG21 27 -#define EF_REG22 28 -#define EF_REG23 29 -#define EF_REG24 30 -#define EF_REG25 31 -/* - * k0/k1 unsaved - */ -#define EF_REG28 34 -#define EF_REG29 35 -#define EF_REG30 36 -#define EF_REG31 37 - -/* - * Saved special registers - */ -#define EF_LO 38 -#define EF_HI 39 - -#define EF_CP0_EPC 40 -#define EF_CP0_BADVADDR 41 -#define EF_CP0_STATUS 42 -#define EF_CP0_CAUSE 43 - -#define EF_SIZE 180 /* size in bytes */ - -#endif /* __ASM_MIPS_REG_H */ - -#else /* _MIPS_SIM != _ABIO32 */ - -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 Ralf Baechle - * Copyright (C) 1995, 1999 Silicon Graphics - */ -#ifndef _ASM_REG_H -#define _ASM_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 0 -#define EF_REG1 1 -#define EF_REG2 2 -#define EF_REG3 3 -#define EF_REG4 4 -#define EF_REG5 5 -#define EF_REG6 6 -#define EF_REG7 7 -#define EF_REG8 8 -#define EF_REG9 9 -#define EF_REG10 10 -#define EF_REG11 11 -#define EF_REG12 12 -#define EF_REG13 13 -#define EF_REG14 14 -#define EF_REG15 15 -#define EF_REG16 16 -#define EF_REG17 17 -#define EF_REG18 18 -#define EF_REG19 19 -#define EF_REG20 20 -#define EF_REG21 21 -#define EF_REG22 22 -#define EF_REG23 23 -#define EF_REG24 24 -#define EF_REG25 25 -/* - * k0/k1 unsaved - */ -#define EF_REG28 28 -#define EF_REG29 29 -#define EF_REG30 30 -#define EF_REG31 31 - -/* - * Saved special registers - */ -#define EF_LO 32 -#define EF_HI 33 - -#define EF_CP0_EPC 34 -#define EF_CP0_BADVADDR 35 -#define EF_CP0_STATUS 36 -#define EF_CP0_CAUSE 37 - -#define EF_SIZE 304 /* size in bytes */ - -#endif /* _ASM_REG_H */ - -#endif /* _MIPS_SIM != _ABIO32 */ - -#if _MIPS_SIM == _ABIO32 - -struct user -{ - unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - void* u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#else - -struct user { - __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ - __extension__ unsigned long u_tsize; /* text size (pages) */ - __extension__ unsigned long u_dsize; /* data size (pages) */ - __extension__ unsigned long u_ssize; /* stack size (pages) */ - __extension__ unsigned long long start_code; /* text starting address */ - __extension__ unsigned long long start_data; /* data starting address */ - __extension__ unsigned long long start_stack; /* stack starting address */ - __extension__ long long signal; /* signal causing core dump */ - __extension__ unsigned long long u_ar0; /* help gdb find registers */ - __extension__ unsigned long long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#endif - -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_DATA_START_ADDR (u.start_data) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif /* _SYS_USER_H */ diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list deleted file mode 100644 index 518f2a2522..0000000000 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ /dev/null @@ -1,31 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -# -# Calls for compatibility with existing MIPS OS implementations and -# compilers. -# -cachectl - cachectl i:pii __cachectl cachectl -cacheflush - cacheflush i:pii _flush_cache cacheflush -sysmips - sysmips i:iiii __sysmips sysmips - -# -# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; -# it's provided for compatibility, though. -# -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect_internal __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/mips/truncate64.c b/sysdeps/unix/sysv/linux/mips/truncate64.c deleted file mode 100644 index 01cc148be9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/truncate64.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006 - 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 <sys/types.h> -#include <endian.h> -#include <errno.h> -#include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_truncate64 -#ifndef __ASSUME_TRUNCATE64_SYSCALL -/* The variable is shared between all wrappers around *truncate64 calls. */ -int __have_no_truncate64; -#endif - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -truncate64 (const char *path, off64_t length) -{ -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (! __have_no_truncate64) -#endif - { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; -#ifndef __ASSUME_TRUNCATE64_SYSCALL - int saved_errno = errno; -#endif - int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0, - __LONG_LONG_PAIR (high, low)); -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (result != -1 || errno != ENOSYS) -#endif - return result; - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - __set_errno (saved_errno); - __have_no_truncate64 = 1; -#endif - } - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if ((off_t) length != length) - { - __set_errno (EINVAL); - return -1; - } - return truncate (path, (off_t) length); -#endif -} - -#else -/* Use the generic implementation. */ -# include <misc/truncate64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S deleted file mode 100644 index 38b6195282..0000000000 --- a/sysdeps/unix/sysv/linux/mips/vfork.S +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 2005 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. */ - -/* vfork() is just a special case of clone(). */ - -#include <sys/asm.h> -#include <sysdep.h> -#include <asm/unistd.h> -#include <sgidefs.h> - -#ifndef SAVE_PID -#define SAVE_PID -#endif - -#ifndef RESTORE_PID -#define RESTORE_PID -#endif - - -/* int vfork() */ - - .text -LOCALSZ= 1 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -GPOFF= FRAMESZ-(1*SZREG) -NESTED(__vfork,FRAMESZ,sp) -#ifdef __PIC__ - SETUP_GP -#endif - PTR_SUBU sp, FRAMESZ - SETUP_GP64 (a5, __vfork) -#ifdef __PIC__ - SAVE_GP (GPOFF) -#endif -#ifdef PROF -# if (_MIPS_SIM != _ABIO32) - PTR_S a5, GPOFF(sp) -# endif - .set noat - move $1, ra -# if (_MIPS_SIM == _ABIO32) - subu sp,sp,8 -# endif - jal _mcount - .set at -# if (_MIPS_SIM != _ABIO32) - PTR_L a5, GPOFF(sp) -# endif -#endif - - PTR_ADDU sp, FRAMESZ - - SAVE_PID - - li a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */ - move a1, sp - - /* Do the system call */ - li v0,__NR_clone - syscall - - RESTORE_PID - - bnez a3,L(error) - - /* Successful return from the parent or child. */ - RESTORE_GP64 - ret - - /* Something bad happened -- no child created. */ -L(error): -#ifdef __PIC__ - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 -#else - RESTORE_GP64 - j __syscall_error -#endif - END(__vfork) - -libc_hidden_def(__vfork) -weak_alias (__vfork, vfork) diff --git a/sysdeps/unix/sysv/linux/mips/xmknod.c b/sysdeps/unix/sysv/linux/mips/xmknod.c deleted file mode 100644 index 2d09752405..0000000000 --- a/sysdeps/unix/sysv/linux/mips/xmknod.c +++ /dev/null @@ -1,51 +0,0 @@ -/* xmknod call using old-style Unix mknod system call. - Copyright (C) 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2002, 2003 - 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 <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/sysmacros.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -/* Create a device file named PATH, with permission and special bits MODE - and device number DEV (which can be constructed from major and minor - device numbers with the `makedev' macro above). */ -int -__xmknod (int vers, const char *path, mode_t mode, dev_t *dev) -{ - unsigned long k_dev; - - if (vers != _MKNOD_VER) - { - __set_errno (EINVAL); - return -1; - } - - /* We must convert the value to dev_t type used by the kernel. */ - k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff); - - return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev); -} - -weak_alias (__xmknod, _xmknod) -libc_hidden_def (__xmknod) diff --git a/sysdeps/unix/sysv/linux/mips/xstatconv.c b/sysdeps/unix/sysv/linux/mips/xstatconv.c deleted file mode 100644 index 41d1cbb768..0000000000 --- a/sysdeps/unix/sysv/linux/mips/xstatconv.c +++ /dev/null @@ -1,133 +0,0 @@ -/* Convert between the kernel's `struct stat' format, and libc's. - Copyright (C) 1991,1995,1996,1997,1998,2000,2003 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 <errno.h> -#include <sys/stat.h> -#include <kernel_stat.h> - -#ifdef STAT_IS_KERNEL_STAT - -/* Dummy. */ -struct kernel_stat; - -#else - -#include <string.h> - - -int -__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) -{ - switch (vers) - { - case _STAT_VER_KERNEL: - /* Nothing to do. The struct is in the form the kernel expects. - We should have short-circuted before we got here, but for - completeness... */ - *(struct kernel_stat *) ubuf = *kbuf; - break; - - case _STAT_VER_LINUX: - { - struct stat *buf = ubuf; - - /* Convert to current kernel version of `struct stat'. */ - buf->st_dev = kbuf->st_dev; - buf->st_pad1[0] = 0; buf->st_pad1[1] = 0; buf->st_pad1[2] = 0; - buf->st_ino = kbuf->st_ino; - buf->st_mode = kbuf->st_mode; - buf->st_nlink = kbuf->st_nlink; - buf->st_uid = kbuf->st_uid; - buf->st_gid = kbuf->st_gid; - buf->st_rdev = kbuf->st_rdev; - buf->st_pad2[0] = 0; buf->st_pad2[1] = 0; - buf->st_pad3 = 0; - buf->st_size = kbuf->st_size; - buf->st_blksize = kbuf->st_blksize; - buf->st_blocks = kbuf->st_blocks; - - buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0; - buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0; - buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0; - - buf->st_pad5[0] = 0; buf->st_pad5[1] = 0; - buf->st_pad5[2] = 0; buf->st_pad5[3] = 0; - buf->st_pad5[4] = 0; buf->st_pad5[5] = 0; - buf->st_pad5[6] = 0; buf->st_pad5[7] = 0; - } - break; - - default: - __set_errno (EINVAL); - return -1; - } - - return 0; -} - -int -__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf) -{ -#ifdef XSTAT_IS_XSTAT64 - return xstat_conv (vers, kbuf, ubuf); -#else - switch (vers) - { - case _STAT_VER_LINUX: - { - struct stat64 *buf = ubuf; - - buf->st_dev = kbuf->st_dev; - buf->st_pad1[0] = 0; buf->st_pad1[1] = 0; buf->st_pad1[2] = 0; - buf->st_ino = kbuf->st_ino; - buf->st_mode = kbuf->st_mode; - buf->st_nlink = kbuf->st_nlink; - buf->st_uid = kbuf->st_uid; - buf->st_gid = kbuf->st_gid; - buf->st_rdev = kbuf->st_rdev; - buf->st_pad2[0] = 0; buf->st_pad2[1] = 0; buf->st_pad2[2] = 0; - buf->st_pad3 = 0; - buf->st_size = kbuf->st_size; - buf->st_blksize = kbuf->st_blksize; - buf->st_blocks = kbuf->st_blocks; - - buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0; - buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0; - buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0; - - buf->st_pad4[0] = 0; buf->st_pad4[1] = 0; - buf->st_pad4[2] = 0; buf->st_pad4[3] = 0; - buf->st_pad4[4] = 0; buf->st_pad4[5] = 0; - buf->st_pad4[6] = 0; buf->st_pad4[7] = 0; - } - break; - - /* If struct stat64 is different from struct stat then - _STAT_VER_KERNEL does not make sense. */ - case _STAT_VER_KERNEL: - default: - __set_errno (EINVAL); - return -1; - } - - return 0; -#endif -} - -#endif /* ! STAT_IS_KERNEL_STAT */ diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c index 38ffe85b56..7dfe367425 100644 --- a/sysdeps/unix/sysv/linux/openat.c +++ b/sysdeps/unix/sysv/linux/openat.c @@ -135,12 +135,16 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode) #endif } +#define UNDERIZE(name) UNDERIZE_1 (name) +#define UNDERIZE_1(name) __##name +#define __OPENAT UNDERIZE (OPENAT) + /* Open FILE with access OFLAG. Interpret relative paths relative to the directory associated with FD. If OFLAG includes O_CREAT, a third argument is the file protection. */ int -OPENAT (fd, file, oflag) +__OPENAT (fd, file, oflag) int fd; const char *file; int oflag; @@ -165,3 +169,5 @@ OPENAT (fd, file, oflag) return res; } +libc_hidden_def (__OPENAT) +weak_alias (__OPENAT, OPENAT) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c index 9a91ba5b2f..e10b40f96c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c @@ -1 +1 @@ -#include <sysdeps/unix/sysv/linux/hppa/umount.c> +#include <sysdeps/unix/sysv/linux/x86_64/umount.c> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 50c3f42469..b86072bd30 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 +/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -149,19 +149,28 @@ arg 3 4 call-clobbered arg 4 5 call-clobbered arg 5 6 call-saved + arg 6 7 call-saved (Of course a function with say 3 arguments does not have entries for arguments 4 and 5.) - S390 does not need to do ANY stack operations to get its parameters - right. + For system calls with 6 parameters a stack operation is required + to load the 6th parameter to register 7. Call saved register 7 is + moved to register 0 and back to avoid an additional stack frame. */ #define DO_CALL(syscall, args) \ + .if args > 5; \ + lr %r0,%r7; \ + l %r7,96(%r15); \ + .endif; \ .if SYS_ify (syscall) < 256; \ svc SYS_ify (syscall); \ .else; \ lhi %r1,SYS_ify (syscall); \ svc 0; \ + .endif; \ + .if args > 5; \ + lr %r7,%r0; \ .endif #define ret \ @@ -255,6 +264,9 @@ #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ DECLARGS_4(arg1, arg2, arg3, arg4) \ register unsigned long gpr6 asm ("6") = (unsigned long)(arg5); +#define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ + DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ + register unsigned long gpr7 asm ("7") = (unsigned long)(arg6); #define ASMFMT_0 #define ASMFMT_1 , "0" (gpr2) @@ -262,6 +274,7 @@ #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) +#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index aadbf74c2b..fc80c9ff86 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -1,5 +1,6 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -150,19 +151,28 @@ arg 3 4 call-clobbered arg 4 5 call-clobbered arg 5 6 call-saved + arg 6 7 call-saved (Of course a function with say 3 arguments does not have entries for arguments 4 and 5.) - S390 does not need to do ANY stack operations to get its parameters - right. + For system calls with 6 parameters a stack operation is required + to load the 6th parameter to register 7. Call saved register 7 is + moved to register 0 and back to avoid an additional stack frame. */ #define DO_CALL(syscall, args) \ + .if args > 5; \ + lgr %r0,%r7; \ + lg %r7,160(%r15); \ + .endif; \ .if SYS_ify (syscall) < 256; \ svc SYS_ify (syscall); \ .else; \ lghi %r1,SYS_ify (syscall); \ svc 0; \ + .endif; \ + .if args > 5; \ + lgr %r7,%r0; \ .endif #define ret \ @@ -256,6 +266,9 @@ #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ DECLARGS_4(arg1, arg2, arg3, arg4) \ register unsigned long gpr6 asm ("6") = (unsigned long)(arg5); +#define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ + DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ + register unsigned long gpr6 asm ("7") = (unsigned long)(arg6); #define ASMFMT_0 #define ASMFMT_1 , "0" (gpr2) @@ -263,6 +276,7 @@ #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) +#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) /* Pointer mangling support. */ #if defined NOT_IN_libc && defined IS_IN_rtld diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index c883002641..9065825b98 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -43,18 +43,18 @@ #define O_ASYNC 020000 #ifdef __USE_GNU -# define O_DIRECT 040000 /* Direct disk access. */ -# define O_DIRECTORY 0200000 /* Must be a directory. */ -# define O_NOFOLLOW 0400000 /* Do not follow links. */ +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_DIRECTORY 0200000 /* Must be a directory. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ # define O_NOATIME 01000000 /* Do not set atime. */ #endif /* For now Linux has synchronisity options for data and read operations. We define the symbols here but let them do the same as O_SYNC since - this is a superset. */ + this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 # define O_DSYNC O_SYNC /* Synchronize data. */ -# define O_RSYNC O_SYNC /* Synchronize read operations. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif #ifdef __USE_LARGEFILE64 @@ -70,15 +70,15 @@ #ifndef __USE_FILE_OFFSET64 # define F_GETLK 5 /* Get record locking info. */ # define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ #else -# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_GETLK F_GETLK64 /* Get record locking info. */ # define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ #endif #define F_GETLK64 12 /* Get record locking info. */ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 14 /* Set record locking info (blocking). */ +#define F_SETLKW64 14 /* Set record locking info (blocking). */ #if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ @@ -90,20 +90,26 @@ # define F_GETSIG 11 /* Get number of signal to be sent. */ #endif +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +#endif + /* For F_[GET|SET]FL. */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ #define F_RDLCK 0 /* Read lock. */ -#define F_WRLCK 1 /* Write lock. */ -#define F_UNLCK 2 /* Remove lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ /* For old implementation of bsd flock(). */ #define F_EXLCK 4 /* or 3 */ #define F_SHLCK 8 /* or 4 */ #ifdef __USE_BSD -/* Operations for bsd flock(), also used by the kernel implementation. */ +/* Operations for bsd flock(), also used by the kernel implementation. */ # define LOCK_SH 1 /* shared lock */ # define LOCK_EX 2 /* exclusive lock */ # define LOCK_NB 4 /* or'd with one of the above to prevent @@ -111,9 +117,27 @@ # define LOCK_UN 8 /* remove lock */ #endif +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + struct flock { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + 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. */ @@ -128,7 +152,7 @@ struct flock #ifdef __USE_LARGEFILE64 struct flock64 { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + 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. */ @@ -150,7 +174,7 @@ struct flock64 #ifdef __USE_XOPEN2K # define POSIX_FADV_NORMAL 0 /* No further special treatment. */ # define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ diff --git a/sysdeps/unix/sysv/linux/sh/chown.c b/sysdeps/unix/sysv/linux/sh/chown.c index 1961622564..e7193dc23b 100644 --- a/sysdeps/unix/sysv/linux/sh/chown.c +++ b/sysdeps/unix/sysv/linux/sh/chown.c @@ -1 +1,69 @@ -#include <sysdeps/unix/sysv/linux/m68k/chown.c> +/* Copyright (C) 1998,2000,2002,2003,2006 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 <errno.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <linux/posix_types.h> +#include <kernel-features.h> + +#ifdef __NR_chown32 +# if __ASSUME_32BITUIDS == 0 +/* This variable is shared with all files that need to check for 32bit + uids. */ +extern int __libc_missing_32bit_uids; +# endif +#endif /* __NR_chown32 */ + +int +__chown (const char *file, uid_t owner, gid_t group) +{ +#if __ASSUME_32BITUIDS > 0 + return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); +#else +# ifdef __NR_chown32 + if (__libc_missing_32bit_uids <= 0) + { + int result; + int saved_errno = errno; + + result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); + if (result == 0 || errno != ENOSYS) + return result; + + __set_errno (saved_errno); + __libc_missing_32bit_uids = 1; + } +# endif /* __NR_chown32 */ + + if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U)) + || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U))) + { + __set_errno (EINVAL); + return -1; + } + + return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); +#endif +} +libc_hidden_def (__chown) +weak_alias (__chown, chown) diff --git a/sysdeps/unix/sysv/linux/sh/fchownat.c b/sysdeps/unix/sysv/linux/sh/fchownat.c index 7acf7918ee..6cc093222d 100644 --- a/sysdeps/unix/sysv/linux/sh/fchownat.c +++ b/sysdeps/unix/sysv/linux/sh/fchownat.c @@ -1 +1,122 @@ -#include <sysdeps/unix/sysv/linux/m68k/fchownat.c> +/* Copyright (C) 2005, 2006 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 <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <linux/posix_types.h> +#include <kernel-features.h> + +#ifdef __NR_chown32 +# if __ASSUME_32BITUIDS == 0 +/* This variable is shared with all files that need to check for 32bit + uids. */ +extern int __libc_missing_32bit_uids; +# endif +#endif /* __NR_chown32 */ + +int +fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag) +{ + if (flag & ~AT_SYMLINK_NOFOLLOW) + { + __set_errno (EINVAL); + return -1; + } + + char *buf = NULL; + + if (fd != AT_FDCWD && file[0] != '/') + { + size_t filelen = strlen (file); + static const char procfd[] = "/proc/self/fd/%d/%s"; + /* Buffer for the path name we are going to use. It consists of + - the string /proc/self/fd/ + - the file descriptor number + - the file name provided. + The final NUL is included in the sizeof. A bit of overhead + due to the format elements compensates for possible negative + numbers. */ + size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; + buf = alloca (buflen); + + __snprintf (buf, buflen, procfd, fd, file); + file = buf; + } + + int result; + INTERNAL_SYSCALL_DECL (err); + +#if __ASSUME_32BITUIDS > 0 + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner, + group); + else + result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner, + group); +#else +# ifdef __NR_chown32 + if (__libc_missing_32bit_uids <= 0) + { + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), + owner, group); + else + result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner, + group); + + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS) + goto fail; + + __libc_missing_32bit_uids = 1; + } +# endif /* __NR_chown32 */ + + if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U)) + || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U))) + { + __set_errno (EINVAL); + return -1; + } + + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lchown, err, 3, CHECK_STRING (file), owner, + group); + else + result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner, + group); +#endif + + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0)) + { + fail: + __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); + result = -1; + } + + return result; +} diff --git a/sysdeps/unix/sysv/linux/sh/pread.c b/sysdeps/unix/sysv/linux/sh/pread.c index 9ded53ebaa..0186e40c9c 100644 --- a/sysdeps/unix/sysv/linux/sh/pread.c +++ b/sysdeps/unix/sysv/linux/sh/pread.c @@ -1,3 +1,93 @@ -#define NO_SGIDEFS_H -#define _MIPS_SIM -1 -#include <sysdeps/unix/sysv/linux/mips/pread.c> +/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + 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 <assert.h> +#include <errno.h> +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pread +# error "__NR_pread and __NR_pread64 both defined???" +# endif +# define __NR_pread __NR_pread64 +#endif + +#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 + +# if __ASSUME_PREAD_SYSCALL == 0 +static ssize_t __emulate_pread (int fd, void *buf, size_t count, + off_t offset) internal_function; +# endif + +ssize_t +__libc_pread (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* First try the syscall. */ + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +# if __ASSUME_PREAD_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread (fd, buf, count, offset); +# endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* First try the syscall. */ + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +# if __ASSUME_PREAD_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread (fd, buf, count, offset); +# endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pread, __pread) +weak_alias (__libc_pread, pread) + +# define __libc_pread(fd, buf, count, offset) \ + static internal_function __emulate_pread (fd, buf, count, offset) +#endif + +#if __ASSUME_PREAD_SYSCALL == 0 +# include <sysdeps/posix/pread.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sh/pread64.c b/sysdeps/unix/sysv/linux/sh/pread64.c index 5b22a395ec..f23d619090 100644 --- a/sysdeps/unix/sysv/linux/sh/pread64.c +++ b/sysdeps/unix/sysv/linux/sh/pread64.c @@ -1,3 +1,94 @@ -#define NO_SGIDEFS_H -#define _MIPS_SIM -1 -#include <sysdeps/unix/sysv/linux/mips/pread64.c> +/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + 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 <errno.h> +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pread +# error "__NR_pread and __NR_pread64 both defined???" +# endif +# define __NR_pread __NR_pread64 +#endif + +#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 + +# if __ASSUME_PREAD_SYSCALL == 0 +static ssize_t __emulate_pread64 (int fd, void *buf, size_t count, + off64_t offset) internal_function; +# endif + +ssize_t +__libc_pread64 (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* First try the syscall. */ + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +# if __ASSUME_PREAD_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread64 (fd, buf, count, offset); +# endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* First try the syscall. */ + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +# if __ASSUME_PREAD_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread64 (fd, buf, count, offset); +# endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pread64, __pread64) +weak_alias (__libc_pread64, pread64) + +# define __libc_pread64(fd, buf, count, offset) \ + static internal_function __emulate_pread64 (fd, buf, count, offset) +#endif + +#if __ASSUME_PREAD_SYSCALL == 0 +# include <sysdeps/posix/pread64.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sh/pwrite.c b/sysdeps/unix/sysv/linux/sh/pwrite.c index b75a6a968e..f0e2bc7e0f 100644 --- a/sysdeps/unix/sysv/linux/sh/pwrite.c +++ b/sysdeps/unix/sysv/linux/sh/pwrite.c @@ -1,3 +1,93 @@ -#define NO_SGIDEFS_H -#define _MIPS_SIM -1 -#include <sysdeps/unix/sysv/linux/mips/pwrite.c> +/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + 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 <assert.h> +#include <errno.h> +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pwrite +# error "__NR_pwrite and __NR_pwrite64 both defined???" +# endif +# define __NR_pwrite __NR_pwrite64 +#endif + +#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 + +# if __ASSUME_PWRITE_SYSCALL == 0 +static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count, + off_t offset) internal_function; +# endif + +ssize_t +__libc_pwrite (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* First try the syscall. */ + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +# if __ASSUME_PWRITE_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite (fd, buf, count, offset); +# endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* First try the syscall. */ + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +# if __ASSUME_PWRITE_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite (fd, buf, count, offset); +# endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pwrite, __pwrite) +weak_alias (__libc_pwrite, pwrite) + +# define __libc_pwrite(fd, buf, count, offset) \ + static internal_function __emulate_pwrite (fd, buf, count, offset) +#endif + +#if __ASSUME_PWRITE_SYSCALL == 0 +# include <sysdeps/posix/pwrite.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sh/pwrite64.c b/sysdeps/unix/sysv/linux/sh/pwrite64.c index ae29280f85..eb1e507287 100644 --- a/sysdeps/unix/sysv/linux/sh/pwrite64.c +++ b/sysdeps/unix/sysv/linux/sh/pwrite64.c @@ -1,3 +1,96 @@ -#define NO_SGIDEFS_H -#define _MIPS_SIM -1 -#include <sysdeps/unix/sysv/linux/mips/pwrite64.c> +/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ralf Baechle <ralf@gnu.org>, 1998. + + 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 <errno.h> +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pwrite +# error "__NR_pwrite and __NR_pwrite64 both defined???" +# endif +# define __NR_pwrite __NR_pwrite64 +#endif + +#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 + +# if __ASSUME_PWRITE_SYSCALL == 0 +static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count, + off64_t offset) internal_function; +# endif + +ssize_t +__libc_pwrite64 (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* First try the syscall. */ + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +# if __ASSUME_PWRITE_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite64 (fd, buf, count, offset); +# endif + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* First try the syscall. */ + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +# if __ASSUME_PWRITE_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite64 (fd, buf, count, offset); +# endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pwrite64, __pwrite64) +libc_hidden_weak (__pwrite64) +weak_alias (__libc_pwrite64, pwrite64) + +# define __libc_pwrite64(fd, buf, count, offset) \ + static internal_function __emulate_pwrite64 (fd, buf, count, offset) +#endif + +#if __ASSUME_PWRITE_SYSCALL == 0 +# include <sysdeps/posix/pwrite64.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/chown.c b/sysdeps/unix/sysv/linux/sparc/sparc32/chown.c index 1961622564..374131695c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/chown.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/chown.c @@ -1 +1 @@ -#include <sysdeps/unix/sysv/linux/m68k/chown.c> +#include <sysdeps/unix/sysv/linux/sh/chown.c> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c b/sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c index 7acf7918ee..7ba5bf44a1 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c @@ -1 +1 @@ -#include <sysdeps/unix/sysv/linux/m68k/fchownat.c> +#include <sysdeps/unix/sysv/linux/sh/fchownat.c> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9b/Implies b/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9b/Implies deleted file mode 100644 index 17ed964f79..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9b/Implies +++ /dev/null @@ -1 +0,0 @@ -unix/sysv/linux/sparc/sparc32/sparcv9 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c deleted file mode 100644 index 0a453a6811..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Data for Linux/sparc64 version of processor capability information. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - 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 information must be kept in sync with the _DL_HWCAP_COUNT - definition in procinfo.h. - - If anything should be added here check whether the size of each string - is still ok with the given array size. - - All the #ifdefs in the definitions ar equite irritating but - necessary if we want to avoid duplicating the information. There - are three different modes: - - - PROCINFO_DECL is defined. This means we are only interested in - declarations. - - - PROCINFO_DECL is not defined: - - + if SHARED is defined the file is included in an array - initializer. The .element = { ... } syntax is needed. - - + if SHARED is not defined a normal array initialization is - needed. - */ - -#ifndef PROCINFO_CLASS -#define PROCINFO_CLASS -#endif - -#if !defined PROCINFO_DECL && defined SHARED - ._dl_sparc64_cap_flags -#else -PROCINFO_CLASS const char _dl_sparc64_cap_flags[6][7] -#endif -#ifndef PROCINFO_DECL -= { - "flush", "stbar", "swap", "muldiv", "v9", "ultra3" - } -#endif -#if !defined SHARED || defined PROCINFO_DECL -; -#else -, -#endif - -#undef PROCINFO_DECL -#undef PROCINFO_CLASS diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h deleted file mode 100644 index 3ce77a40e8..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Linux/sparc64 version of processor capability information handling macros. - Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999. - - 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 _DL_PROCINFO_H -#define _DL_PROCINFO_H 1 - -#include <ldsodefs.h> - -#define _DL_HWCAP_COUNT 6 - -static inline int -__attribute__ ((unused)) -_dl_procinfo (int word) -{ - int i; - - _dl_printf ("AT_HWCAP: "); - - for (i = 0; i < _DL_HWCAP_COUNT; ++i) - if (word & (1 << i)) - _dl_printf (" %s", GLRO(dl_sparc64_cap_flags)[i]); - - _dl_printf ("\n"); - - return 0; -} - -static inline const char * -__attribute__ ((unused)) -_dl_hwcap_string (int idx) -{ - return GLRO(dl_sparc64_cap_flags)[idx]; -}; - - -static inline int -__attribute__ ((unused)) -_dl_string_hwcap (const char *str) -{ - int i; - for (i = 0; i < _DL_HWCAP_COUNT; i++) - { - if (strcmp (str, GLRO(dl_sparc64_cap_flags) [i]) == 0) - return i; - } - return -1; -}; - -#define HWCAP_IMPORTANT (HWCAP_SPARC_ULTRA3) - -/* There are no different platforms defined. */ -#define _dl_platform_string(idx) "" - -/* There're no platforms to filter out. */ -#define _DL_HWCAP_PLATFORM 0 - -#define _dl_string_platform(str) (-1) - -#endif /* dl-procinfo.h */ diff --git a/sysdeps/unix/sysv/linux/x86_64/brk.c b/sysdeps/unix/sysv/linux/x86_64/brk.c index 09b7dd4707..8b18c4dbb9 100644 --- a/sysdeps/unix/sysv/linux/x86_64/brk.c +++ b/sysdeps/unix/sysv/linux/x86_64/brk.c @@ -1 +1,42 @@ -#include <sysdeps/unix/sysv/linux/hppa/brk.c> +/* brk system call for Linux/x86_64. + Copyright (C) 1995, 1996, 2000, 2001, 2006 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 <errno.h> +#include <unistd.h> +#include <sysdep.h> + +/* This must be initialized data because commons can't have aliases. */ +void *__curbrk = 0; + +int +__brk (void *addr) +{ + void *newbrk; + + __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h index cffddb58b3..02672d3c75 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h +++ b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2004,2005,2006 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 @@ -98,9 +98,12 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, "events" parameter is a buffer that will contain triggered events. The "maxevents" is the maximum number of events to be returned ( usually size of "events" ). The "timeout" parameter - specifies the maximum wait time in milliseconds (-1 == infinite). */ + specifies the maximum wait time in milliseconds (-1 == infinite). + + This function is a cancellation point and therefore not marked with + __THROW. */ extern int epoll_wait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout) __THROW; + int __maxevents, int __timeout); __END_DECLS diff --git a/sysdeps/unix/sysv/linux/x86_64/umount.c b/sysdeps/unix/sysv/linux/x86_64/umount.c index 9a91ba5b2f..a17c5c5799 100644 --- a/sysdeps/unix/sysv/linux/x86_64/umount.c +++ b/sysdeps/unix/sysv/linux/x86_64/umount.c @@ -1 +1,31 @@ -#include <sysdeps/unix/sysv/linux/hppa/umount.c> +/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Huggins-Daines <dhd@debian.org>, 2000. + + 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. */ + +/* Since we don't have an oldumount system call, do what the kernel + does down here. */ + +extern long int __umount2 (const char *name, int flags); + +long int +__umount (const char *name) +{ + return __umount2 (name, 0); +} + +weak_alias (__umount, umount); diff --git a/timezone/africa b/timezone/africa index 153e2546b3..29625df934 100644 --- a/timezone/africa +++ b/timezone/africa @@ -1,4 +1,4 @@ -# @(#)africa 7.40 +# @(#)africa 8.1 # <pre> # This data is by no means authoritative; if you think you know better, diff --git a/timezone/antarctica b/timezone/antarctica index f3efe19b68..8a9ea939c9 100644 --- a/timezone/antarctica +++ b/timezone/antarctica @@ -1,4 +1,4 @@ -# @(#)antarctica 7.30 +# @(#)antarctica 8.1 # <pre> # From Paul Eggert (1999-11-15): diff --git a/timezone/asia b/timezone/asia index 059ad7f245..446cc16e6f 100644 --- a/timezone/asia +++ b/timezone/asia @@ -1,4 +1,4 @@ -# @(#)asia 7.91 +# @(#)asia 8.1 # <pre> # This data is by no means authoritative; if you think you know better, diff --git a/timezone/australasia b/timezone/australasia index 6cf9761012..70b845560e 100644 --- a/timezone/australasia +++ b/timezone/australasia @@ -1,4 +1,4 @@ -# @(#)australasia 7.78 +# @(#)australasia 8.1 # <pre> # This file also includes Pacific islands. diff --git a/timezone/backward b/timezone/backward index 4ddfe41e99..66fbf30618 100644 --- a/timezone/backward +++ b/timezone/backward @@ -1,4 +1,4 @@ -# @(#)backward 7.30 +# @(#)backward 8.1 # This file provides links between current names for time zones # and their old names. Many names changed in late 1993. diff --git a/timezone/etcetera b/timezone/etcetera index 431206ec3d..cddbe8a294 100644 --- a/timezone/etcetera +++ b/timezone/etcetera @@ -1,4 +1,4 @@ -# @(#)etcetera 7.12 +# @(#)etcetera 8.1 # These entries are mostly present for historical reasons, so that # people in areas not otherwise covered by the tz files could "zic -l" diff --git a/timezone/europe b/timezone/europe index 8782860e86..54146d7400 100644 --- a/timezone/europe +++ b/timezone/europe @@ -1,4 +1,4 @@ -# @(#)europe 7.96 +# @(#)europe 8.1 # <pre> # This data is by no means authoritative; if you think you know better, diff --git a/timezone/factory b/timezone/factory index ba27c63269..946063c0dd 100644 --- a/timezone/factory +++ b/timezone/factory @@ -1,4 +1,4 @@ -# @(#)factory 7.3 +# @(#)factory 8.1 # For companies who don't want to put time zone specification in # their installation procedures. When users run date, they'll get the message. diff --git a/timezone/iso3166.tab b/timezone/iso3166.tab index 07b43fc7c4..1cfaf265c2 100644 --- a/timezone/iso3166.tab +++ b/timezone/iso3166.tab @@ -1,6 +1,6 @@ # ISO 3166 alpha-2 country codes # -# @(#)iso3166.tab 1.17 +# @(#)iso3166.tab 8.1 # # From Paul Eggert (2004-06-14): # diff --git a/timezone/leapseconds b/timezone/leapseconds index a1078837d7..d2b506bab5 100644 --- a/timezone/leapseconds +++ b/timezone/leapseconds @@ -1,4 +1,4 @@ -# @(#)leapseconds 7.20 +# @(#)leapseconds 8.1 # Allowance for leapseconds added to each timezone file. diff --git a/timezone/northamerica b/timezone/northamerica index 087fa544e6..73e2470e0b 100644 --- a/timezone/northamerica +++ b/timezone/northamerica @@ -1,4 +1,4 @@ -# @(#)northamerica 7.88 +# @(#)northamerica 8.1 # <pre> # also includes Central America and the Caribbean diff --git a/timezone/pacificnew b/timezone/pacificnew index 86dd688341..667940bf53 100644 --- a/timezone/pacificnew +++ b/timezone/pacificnew @@ -1,4 +1,4 @@ -# @(#)pacificnew 7.10 +# @(#)pacificnew 8.1 # From Arthur David Olson (1989-04-05): # On 1989-04-05, the U. S. House of Representatives passed (238-154) a bill diff --git a/timezone/solar87 b/timezone/solar87 index 21ba2c2d64..71839320ad 100644 --- a/timezone/solar87 +++ b/timezone/solar87 @@ -1,4 +1,4 @@ -# @(#)solar87 7.4 +# @(#)solar87 8.1 # So much for footnotes about Saudi Arabia. # Apparent noon times below are for Riyadh; your mileage will vary. diff --git a/timezone/solar88 b/timezone/solar88 index 7e15f2b077..b4cfe8e37a 100644 --- a/timezone/solar88 +++ b/timezone/solar88 @@ -1,4 +1,4 @@ -# @(#)solar88 7.4 +# @(#)solar88 8.1 # Apparent noon times below are for Riyadh; they're a bit off for other places. # Times were computed using formulas in the U.S. Naval Observatory's diff --git a/timezone/solar89 b/timezone/solar89 index 3c36b6a30d..8c48531461 100644 --- a/timezone/solar89 +++ b/timezone/solar89 @@ -1,4 +1,4 @@ -# @(#)solar89 7.5 +# @(#)solar89 8.1 # Apparent noon times below are for Riyadh; they're a bit off for other places. # Times were computed using a formula provided by the U. S. Naval Observatory: diff --git a/timezone/southamerica b/timezone/southamerica index eb7b5c7d84..3a61cd717a 100644 --- a/timezone/southamerica +++ b/timezone/southamerica @@ -1,4 +1,4 @@ -# @(#)southamerica 7.66 +# @(#)southamerica 8.1 # <pre> # This data is by no means authoritative; if you think you know better, diff --git a/timezone/systemv b/timezone/systemv index a5b4209c3f..6cf9645de0 100644 --- a/timezone/systemv +++ b/timezone/systemv @@ -1,4 +1,4 @@ -# @(#)systemv 7.5 +# @(#)systemv 8.1 # Old rules, should the need arise. # No attempt is made to handle Newfoundland, since it cannot be expressed diff --git a/timezone/zone.tab b/timezone/zone.tab index b2e12460e9..09cdf6940a 100644 --- a/timezone/zone.tab +++ b/timezone/zone.tab @@ -1,4 +1,4 @@ -# @(#)zone.tab 1.33 +# @(#)zone.tab 8.1 # # TZ zone descriptions # |