diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-03-03 18:18:04 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-03-03 18:18:04 +0000 |
commit | c0102611b1f1bd1ce2a2952e9b74ff33fa02717e (patch) | |
tree | 31177266a6797f3c30d0493619d0f06f3f59afe1 /ports | |
parent | 33f3f8954d202664c7c7a224d13ba5a0c14a0e01 (diff) |
Merge changes between r17194 and r17384 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@17385 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'ports')
115 files changed, 1069 insertions, 3292 deletions
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha index 5b98b1ec4..32e851528 100644 --- a/ports/ChangeLog.alpha +++ b/ports/ChangeLog.alpha @@ -1,3 +1,26 @@ +2012-02-21 Richard Henderson <rth@twiddle.net> + + * sysdeps/unix/sysv/linux/alpha/bits/epoll.h: New file. + * sysdeps/unix/sysv/linux/alpha/bits/timerfd.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/sys/epoll.h: Remove. + * sysdeps/unix/sysv/linux/alpha/sys/timerfd.h: Likewise. + +2012-02-20 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/unix/sysv/linux/alpha/bits/errno.h (ERFKILL, EHWPOISON): + Define if not defined. + * sysdeps/unix/sysv/linux/alpha/Versions: Add new errlist compat + entry for 2.16. + +2012-02-20 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/unix/sysv/linux/alpha/sysconf.c: Fix cache sysconf switch. + +2012-02-16 Richard Henderson <rth@twiddle.net> + + * sysdeps/alpha/fpu/fenv_libc.h (__ieee_set_fp_control, + __ieee_get_fp_control): Mark as hidden proto. + 2012-02-15 Mike Hommey <mh+reportbug@glandium.org> [BZ #11677] @@ -5,8 +28,8 @@ 2012-02-15 Richard Henderson <rth@twiddle.net> - * sysdeps/unix/sysv/linux/alpha/bits/signalfd.h: New file. - * sysdeps/unix/sysv/linux/alpha/sys/signalfd.h: Remove. + * sysdeps/unix/sysv/linux/alpha/bits/signalfd.h: New file. + * sysdeps/unix/sysv/linux/alpha/sys/signalfd.h: Remove. * sysdeps/unix/alpha/sysdep.h (syscall_promote): New. (inline_syscall0, inline_syscall1, inline_syscall2, @@ -42,8 +65,8 @@ 2012-02-13 Richard Henderson <rth@twiddle.net> - * sysdeps/unix/sysv/linux/alpha/bits/eventfd.h: New file. - * sysdeps/unix/sysv/linux/alpha/sys/eventfd.h: Remove. + * sysdeps/unix/sysv/linux/alpha/bits/eventfd.h: New file. + * sysdeps/unix/sysv/linux/alpha/sys/eventfd.h: Remove. 2012-02-09 Richard Henderson <rth@twiddle.net> @@ -153,7 +176,7 @@ 2010-05-03 Aurelien Jarno <aurelien@aurel32.net> - [BZ #6827] + [BZ #6827] * sysdeps/alpha/dl-machine.h: Add dl-procinfo support. * sysdeps/alpha/dl-procinfo.c: New. * sysdeps/alpha/dl-procinfo.h: New. diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm index 9eef7e7d6..982699cb2 100644 --- a/ports/ChangeLog.arm +++ b/ports/ChangeLog.arm @@ -1,3 +1,14 @@ +2012-02-27 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h + (pthread_attr_t): Change union tag to pthread_attr_t. Only define + typedef if not already defined. + +2012-02-26 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h: Name + pthread_attr_t union. + 2012-02-17 Aurelien Jarno <aurelien@aurel32.net> * sysdeps/arm/libm-test-ulps: Adjust ULPs for jn tests. diff --git a/ports/ChangeLog.cris b/ports/ChangeLog.cris index da1ad973f..2f8cd7c4e 100644 --- a/ports/ChangeLog.cris +++ b/ports/ChangeLog.cris @@ -1,3 +1,8 @@ +2012-02-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/cris: Remove. + * sysdeps/unix/sysv/linux/cris: Likewise. + 2011-10-05 Andreas Schwab <schwab@redhat.com> * sysdeps/cris/dl-machine.h (elf_machine_rela) diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k index 7eace9206..1ab074f9f 100644 --- a/ports/ChangeLog.m68k +++ b/ports/ChangeLog.m68k @@ -1,3 +1,61 @@ +2012-03-02 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update ULPs. + +2012-02-27 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h + (pthread_attr_t): Fix name of union. Only define if not already + defined. + +2012-02-26 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: Name + pthread_attr_t union. + + * sysdeps/m68k/m680x0/fpu/Makefile: Remove. + * sysdeps/m68k/m680x0/fpu/switch: Remove directory. + + * sysdeps/m68k/m680x0/fpu/k_sinl.c: Replace by empty file. + * sysdeps/m68k/m680x0/fpu/k_cosl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/k_tanf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/k_tanl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/k_sin.c: Remove. + * sysdeps/m68k/m680x0/fpu/k_sinf.c: Remove. + * sysdeps/m68k/m680x0/fpu/k_cos.c: Remove. + * sysdeps/m68k/m680x0/fpu/k_cosf.c: Remove. + * sysdeps/m68k/m680x0/fpu/k_tan.c: Remove. + +2012-02-25 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Avoid raising invalid + exception for NaN+iNaN. + +2012-02-24 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update ULPs. + + * sysdeps/m68k/m680x0/fpu/s_expm1.c: Set errno to ERANGE if + argument causes overflow. + * sysdeps/m68k/m680x0/fpu/s_expm1f.c: Include <s_expm1.c>. + (float_type, o_threshold): Define. + * sysdeps/m68k/m680x0/fpu/s_expm1l.c: Likewise. + * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__OPTIMIZE__]: Don't + define expm1 as inline. + + * sysdeps/m68k/m680x0/fpu/s_sin.c: Set errno to EDOM if argument + is infinite. + * sysdeps/m68k/m680x0/fpu/s_cos.c: Include <s_sin.c>. + * sysdeps/m68k/m680x0/fpu/s_tan.c: Likewise. + * sysdeps/m68k/m680x0/fpu/s_cosf.c: Include <s_sinf.c>. + * sysdeps/m68k/m680x0/fpu/s_cosl.c: Include <s_sinl.c>. + * sysdeps/m68k/m680x0/fpu/s_sinf.c: Include <s_sin.c>. + (FUNC): Don't define if already defined. + (float_type): Define. + * sysdeps/m68k/m680x0/fpu/s_sinl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__OPTIMIZE__]: Don't + define sin, cos, tan as inlines. + 2012-02-08 Andreas Schwab <schwab@linux-m68k.org> * sysdeps/m68k/crti.S: New file. diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips index 172d48da7..730e42683 100644 --- a/ports/ChangeLog.mips +++ b/ports/ChangeLog.mips @@ -1,3 +1,37 @@ +2012-02-27 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/bits/socket.h [!__USE_GNU]: Do not + declare recvmmsg and sendmmsg. + +2012-02-27 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/bits/siginfo.h (pthread_attr_t): + Change union tag to pthread_attr_t. Only define typedef if not + already defined. + * sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h + (pthread_attr_t): Change union tag to pthread_attr_t. Only define + typedef if not already defined. + +2012-02-26 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/bits/siginfo.h: Don't name + siginfo_t struct. Add forward declaration of pthread_attr_t and + use it in sigevent. + * sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h: Name + pthread_attr_t union. + +2012-02-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/bits/epoll.h: New file. + * sysdeps/unix/sysv/linux/mips/bits/timerfd.h: Likewise. + * sysdeps/unix/sysv/linux/mips/sys/epoll.h: Remove. + * sysdeps/unix/sysv/linux/mips/sys/timerfd.h: Likewise. + +2012-02-20 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/unix/sysv/linux/mips/bits/errno.h (EHWPOISON): Define if + not defined. + 2012-02-17 Aurelien Jarno <aurelien@aurel32.net> * sysdeps/mips/dl-procinfo.h(_DL_PLATFORMS_COUNT): define to 4, diff --git a/ports/ChangeLog.powerpc b/ports/ChangeLog.powerpc index 36a88d69d..f258b4633 100644 --- a/ports/ChangeLog.powerpc +++ b/ports/ChangeLog.powerpc @@ -1,3 +1,8 @@ +2012-02-20 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/powerpc/nofpu/libm-test-ulps: Resort with + gen-libm-test.pl -n in C locale. + 2010-09-03 Luis Machado <luisgpm@br.ibm.com> * sysdeps/powerpc/dl-procinfo.c: New file. diff --git a/ports/sysdeps/alpha/fpu/fenv_libc.h b/ports/sysdeps/alpha/fpu/fenv_libc.h index f1d187d9e..edcc65496 100644 --- a/ports/sysdeps/alpha/fpu/fenv_libc.h +++ b/ports/sysdeps/alpha/fpu/fenv_libc.h @@ -1,5 +1,5 @@ /* Internal libc stuff for floating point environment routines. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,4 +33,8 @@ | SWCR_MAP_MASK \ | SWCR_STATUS_MASK) +/* These are declared for public consumption in <bits/fenv.h>. */ +libc_hidden_proto(__ieee_set_fp_control) +libc_hidden_proto(__ieee_get_fp_control) + #endif /* fenv_libc.h */ diff --git a/ports/sysdeps/cris/Implies b/ports/sysdeps/cris/Implies deleted file mode 100644 index 780c4e246..000000000 --- a/ports/sysdeps/cris/Implies +++ /dev/null @@ -1,3 +0,0 @@ -wordsize-32 -ieee754/flt-32 -ieee754/dbl-64 diff --git a/ports/sysdeps/cris/Makefile b/ports/sysdeps/cris/Makefile deleted file mode 100644 index 1ecb78c3e..000000000 --- a/ports/sysdeps/cris/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 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. - -# We don't support long doubles as a distinct type. We don't need to set -# this variable; it's here mostly for documentational purposes. - -long-double-fcts = no - -# FIXME: Note that this is a machine-specific stub; profiling is not -# implemented. -ifeq ($(subdir),gmon) -sysdep_routines += _mcount -endif - -# FIXME: This test seems generally bogus. Wrong types in function calls -# and assumes FE_TONEAREST is defined. Does it work somewhere? -# Presumably it does, so let's settle for filtering it out target-wise -# until it's agreed what should be done. -ifeq ($(subdir),math) -tests := $(filter-out test-fenv, $(tests)) -endif - -# PIC code must be assembled with special options, passed on by gcc when -# given the -fpic option. -ASFLAGS-.os = -fpic - -# Overflow occurs at 2**15/4 (8192) symbols. Glibc uses about 2000. -# So use -fpic: smaller-size relocs; smaller, faster code. -pic-ccflag = -fpic diff --git a/ports/sysdeps/cris/__longjmp.S b/ports/sysdeps/cris/__longjmp.S deleted file mode 100644 index cce27ca25..000000000 --- a/ports/sysdeps/cris/__longjmp.S +++ /dev/null @@ -1,38 +0,0 @@ -/* longjmp for CRIS. - 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. */ - -#include <sysdep.h> -#define _SETJMP_H -#define _ASM -#include <bits/setjmp.h> - - .syntax no_register_prefix - -/* Saving and restoring CCR is meaningless, so we don't do it. */ -ENTRY (__longjmp) - /* Note that r10 = jmp_buf, r11 = retval. */ - move [r10+16*4],srp - test.d r11 - beq 0f /* Already a 1 in place. */ - nop - /* Offset for r9, the return value (see setjmp). */ - move.d r11,[r10+6*4] -0: - movem [r10],pc -END (__longjmp) diff --git a/ports/sysdeps/cris/_mcount.S b/ports/sysdeps/cris/_mcount.S deleted file mode 100644 index a93913164..000000000 --- a/ports/sysdeps/cris/_mcount.S +++ /dev/null @@ -1,36 +0,0 @@ -/* Machine-specific calling sequence for `mcount' profiling function for CRIS. - 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. */ - -/* FIXME: This isn't implemented yet. This is just a machine-specific - stub. Perhaps a real implementation can make use of it. */ - -#include <sysdep.h> - -#undef CALL_MCOUNT -#define CALL_MCOUNT - -ENTRY (_mcount) - SETUP_PIC - /* Sorry, isn't implemented yet. - Can't call abort; that will recurse. Force SEGV instead. */ - test.d [99] -1: - ba 1b - nop -END (_mcount) diff --git a/ports/sysdeps/cris/bits/endian.h b/ports/sysdeps/cris/bits/endian.h deleted file mode 100644 index 034307e39..000000000 --- a/ports/sysdeps/cris/bits/endian.h +++ /dev/null @@ -1,7 +0,0 @@ -/* CRIS is little-endian. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/ports/sysdeps/cris/bits/setjmp.h b/ports/sysdeps/cris/bits/setjmp.h deleted file mode 100644 index fa62a85de..000000000 --- a/ports/sysdeps/cris/bits/setjmp.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 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. */ - -/* Define the machine-dependent type `jmp_buf', CRIS version. */ - -/* Note that saving and restoring CCR has no meaning in user mode, so we - don't actually do it; the slot is now reserved. - - jmp_buf[0] - PC - jmp_buf[1] - SP (R14) - jmp_buf[2] - R13 - jmp_buf[3] - R12 - jmp_buf[4] - R11 - jmp_buf[5] - R10 - jmp_buf[6] - R9 - jmp_buf[7] - R8 - jmp_buf[8] - R7 - jmp_buf[9] - R6 - jmp_buf[10] - R5 - jmp_buf[11] - R4 - jmp_buf[12] - R3 - jmp_buf[13] - R2 - jmp_buf[14] - R1 - jmp_buf[15] - R0 - jmp_buf[16] - SRP - jmp_buf[17] - CCR */ - -#ifndef _ASM -typedef unsigned long int __jmp_buf[18]; -#endif - -#if defined (__USE_MISC) || defined (_ASM) -#define JB_SP 1 -#endif - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((unsigned long int) (address) < demangle ((jmpbuf)[JB_SP])) diff --git a/ports/sysdeps/cris/bits/string.h b/ports/sysdeps/cris/bits/string.h deleted file mode 100644 index fa893d365..000000000 --- a/ports/sysdeps/cris/bits/string.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Optimized, inlined string functions. CRIS version. - 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 _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/ports/sysdeps/cris/configure b/ports/sysdeps/cris/configure deleted file mode 100755 index 205bbac85..000000000 --- a/ports/sysdeps/cris/configure +++ /dev/null @@ -1,7 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - -libc_cv_asm_line_sep='@' -cat >>confdefs.h <<_ACEOF -#define ASM_LINE_SEP $libc_cv_asm_line_sep -_ACEOF - diff --git a/ports/sysdeps/cris/configure.in b/ports/sysdeps/cris/configure.in deleted file mode 100644 index 94bc13750..000000000 --- a/ports/sysdeps/cris/configure.in +++ /dev/null @@ -1,5 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. - -dnl CRIS uses `;' to start comments and `@' for line separator. -libc_cv_asm_line_sep='@' -AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep) diff --git a/ports/sysdeps/cris/dl-machine.h b/ports/sysdeps/cris/dl-machine.h deleted file mode 100644 index cc3701e59..000000000 --- a/ports/sysdeps/cris/dl-machine.h +++ /dev/null @@ -1,392 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. CRIS version. - Copyright (C) 1996-2001, 2002, 2003, 2011 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along 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 "CRIS" - -#include <sys/param.h> - -#ifdef __PIC__ -# define CALL_FN(x) \ - "move.d $pc,$r9\n\t" \ - "add.d " #x " - .,$r9\n\t" \ - "jsr $r9" -#else -# define CALL_FN(x) "jsr " #x -#endif - -/* 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_CRIS; -} - -/* 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) -{ - /* Don't just set this to an asm variable "r0" since that's not logical - (like, the variable is uninitialized and the register is fixed) and - may make GCC trip over itself doing register allocation. Yes, I'm - paranoid. Why do you ask? */ - Elf32_Addr *got; - - __asm__ ("move.d $r0,%0" : "=rm" (got)); - return *got; -} - -/* Return the run-time load address of the shared object. We do it like - m68k and i386, by taking an arbitrary local symbol, forcing a GOT entry - for it, and peeking into the GOT table, which is set to the link-time - file-relative symbol value (regardless of whether the target is REL or - RELA). We subtract this link-time file-relative value from the "local" - value we calculate from GOT position and GOT offset. FIXME: Perhaps - there's some other symbol we could use, that we don't *have* to force a - GOT entry for. */ - -static inline Elf32_Addr -elf_machine_load_address (void) -{ - Elf32_Addr gotaddr_diff; - __asm__ ("sub.d [$r0+_dl_start:GOT16],$r0,%0\n\t" - "add.d _dl_start:GOTOFF,%0" : "=r" (gotaddr_diff)); - return gotaddr_diff; -} - -/* 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; - 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 (__builtin_expect (profile, 0)) - { - got[2] = (Elf32_Addr) &_dl_runtime_profile; - - if (_dl_name_match_p (GL(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; -} - -/* This code is used in dl-runtime.c to call the `fixup' function - and then redirect to the address it returns. - - We get here with the offset into the relocation table pushed on stack, - and the link map in MOF. */ - -#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \ -"; Trampoline for " #fixup_name "\n\ - .globl " #tramp_name "\n\ - .type " #tramp_name ", @function\n\ -" #tramp_name ":\n\ - push $r13\n\ - push $r12\n\ - push $r11\n\ - push $r10\n\ - push $r9\n\ - push $srp\n\ - move.d [$sp+6*4],$r11\n\ - move $mof,$r10\n\ - " CALL_FN (fixup_name) "\n\ - move.d $r10,[$sp+6*4]\n\ - pop $srp\n\ - pop $r9\n\ - pop $r10\n\ - pop $r11\n\ - pop $r12\n\ - pop $r13\n\ - jump [$sp+]\n\ - .size " #tramp_name ", . - " #tramp_name "\n" -#ifndef PROF -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ -asm (TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup) \ - TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup)); -#else -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ -asm (TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup) \ - ".globl _dl_runtime_profile\n" \ - ".set _dl_runtime_profile, _dl_runtime_resolve"); -#endif - - -/* Mask identifying addresses reserved for the user program, - where the dynamic linker should not map anything. */ -#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL - -/* 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.d $sp,$r10\n\ - " CALL_FN (_dl_start) "\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 R1.\n\ - move.d $r10,$r1\n\ - ; Point R0 at the GOT.\n\ - move.d $pc,$r0\n\ - sub.d .:GOTOFF,$r0\n\ - ; See if we were run as a command with the executable file\n\ - ; name as an extra leading argument.\n\ - move.d [$r0+_dl_skip_args:GOT16],$r13\n\ - move.d [$r13],$r9\n\ - ; Get the original argument count\n\ - move.d [$sp],$r11\n\ - ; Subtract _dl_skip_args from it.\n\ - sub.d $r9,$r11\n\ - ; Adjust the stack pointer to skip _dl_skip_args words.\n\ - addi $r9.d,$sp\n\ - ; Put the new argc in place as expected by the user entry.\n\ - move.d $r11,[$sp]\n\ - ; Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\ - ; env: skip scaled argc and skip stored argc and NULL at end of argv[].\n\ - move.d $sp,$r13\n\ - addi $r11.d,$r13\n\ - addq 8,$r13\n\ - ; argv: skip stored argc.\n\ - move.d $sp,$r12\n\ - addq 4,$r12\n\ - ; main_map: at _dl_loaded.\n\ - move.d [$r0+_rtld_local:GOT16],$r9\n\ - move.d [$r9],$r10\n\ - move.d _dl_init_internal:PLTG,$r9\n\ - add.d $r0,$r9\n\ - jsr $r9\n\ - ; Pass our finalizer function to the user in R10.\n\ - move.d [$r0+_dl_fini:GOT16],$r10\n\ - ; Terminate the frame-pointer.\n\ - moveq 0,$r8\n\ - ; Cause SEGV if user entry returns.\n\ - move $r8,$srp\n\ - ; Jump to the user's entry point.\n\ - jump $r1\n\ - .size _dl_start_user, . - _dl_start_user\n\ - .previous"); - -/* The union of reloc-type-classes where the reloc TYPE is a member. - - TYPE is in the class ELF_RTYPE_CLASS_PLT if it can describe a - relocation for a PLT entry, that is, for which a PLT entry should not - be allowed to define the value. The GNU linker for CRIS can merge a - .got.plt entry (R_CRIS_JUMP_SLOT) with a .got entry (R_CRIS_GLOB_DAT), - so we need to match both these reloc types. - - TYPE is in the class ELF_RTYPE_CLASS_NOCOPY if it 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_CRIS_JUMP_SLOT)) \ - || ((type) == R_CRIS_GLOB_DAT)) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_CRIS_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_CRIS_JUMP_SLOT - -/* CRIS never uses Elf32_Rel relocations. */ -#define ELF_MACHINE_NO_REL 1 - -/* 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 (GL(dl_platform) != NULL && *GL(dl_platform) == '\0') - /* Avoid an empty string which would disturb us. */ - GL(dl_platform) = NULL; -} - -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. */ -static inline Elf32_Addr -elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, - Elf32_Addr value) -{ - return value + reloc->r_addend; -} - -#endif /* !dl_machine_h */ - -#ifdef RESOLVE - -/* Perform the relocation specified by RELOC and SYM (which is fully resolved). - MAP is the object containing the reloc. */ - -static inline void -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, int skip_ifunc) -{ - 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_CRIS_RELATIVE, 0)) - *reloc_addr = map->l_addr + reloc->r_addend; - else - { -#ifndef RTLD_BOOTSTRAP - const Elf32_Sym *const refsym = sym; -#endif - Elf32_Addr value; - if (sym->st_shndx != SHN_UNDEF - && ELF32_ST_BIND (sym->st_info) == STB_LOCAL) - value = map->l_addr; - else - { - value = RESOLVE (&sym, version, r_type); - if (sym) - value += sym->st_value; - } - value += reloc->r_addend; /* Assume copy relocs have zero addend. */ - - switch (r_type) - { -#ifndef RTLD_BOOTSTRAP - case R_CRIS_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 - || (GL(dl_verbose) && sym->st_size < refsym->st_size)) - { - 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_CRIS_32: -#endif - case R_CRIS_GLOB_DAT: - case R_CRIS_JUMP_SLOT: - *reloc_addr = value; - break; -#ifndef RTLD_BOOTSTRAP - case R_CRIS_8: - *(char *) reloc_addr = value; - break; - case R_CRIS_16: - *(short *) reloc_addr = value; - break; - case R_CRIS_8_PCREL: - *(char *) reloc_addr - = value + reloc->r_addend - (Elf32_Addr) reloc_addr - 1; - break; - case R_CRIS_16_PCREL: - *(short *) reloc_addr - = value + reloc->r_addend - (Elf32_Addr) reloc_addr - 2; - break; - case R_CRIS_32_PCREL: - *reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr - 4; - break; -#endif - case R_CRIS_NONE: - break; -#if !defined RTLD_BOOTSTRAP || defined _NDEBUG - default: - _dl_reloc_bad_type (map, r_type, 0); - break; -#endif - } - } -} - -static inline void -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; -} - -static inline void -elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc, - int skip_ifunc) -{ - Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); - const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); - if (__builtin_expect (r_type == R_CRIS_JUMP_SLOT, 1)) - *reloc_addr += l_addr; - else - _dl_reloc_bad_type (map, r_type, 1); -} - -#endif /* RESOLVE */ diff --git a/ports/sysdeps/cris/elf/start.S b/ports/sysdeps/cris/elf/start.S deleted file mode 100644 index a3f85bcd0..000000000 --- a/ports/sysdeps/cris/elf/start.S +++ /dev/null @@ -1,141 +0,0 @@ -/* Startup code compliant to the ELF CRIS ABI (to-be-written). - 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. - - 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. */ - -#include <sysdep.h> - -/* This is the canonical entry point, usually the first thing in the text - segment. When the entry point runs, most registers' values are - unspecified, except for: - - R10 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: - [SP] argc - [SP+4] argv[0] - ... - [SP+4*argc] NULL - [SP+4*(argc+1)] envp[0] - ... - NULL -*/ - - .syntax no_register_prefix - - .text - .globl _start - .type _start,@function -_start: - /* Clear the frame pointer, to mark the outermost frame. */ - moveq 0,r8 - - /* Move the shared library termination function to the right place - for __libc_main. */ - move.d r10,r9 - - /* 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. */ - - /* Get the argument count. */ - move.d [sp],r11 - - /* Store the stack pointer as end of stack. We overwrite - the incoming argc. */ - move.d sp,[sp] - - /* The argument vector starts just after the argument count. */ - move.d sp,r12 - addq 4,r12 - - /* There are seven arguments to __libc_start_main: - r10: main - Address of it. - r11: argc - r12: argv - r13: init - Function to call. - - [sp]: fini - Function to register with atexit. - [sp+4]: rtld_fini - Another function to register with atexit. - [sp+8]: stack_end - Top of stack (actually same as argv). - - The last two are passed on stack. */ - - /* Store the fini function coming from the dynamic loader. */ - push r9 - - /* Get the addresses of our own entry points to `.fini' and - `.init'. */ - -#ifdef __PIC__ - /* If for some reason this program is compiled as PIC, set up R0. */ - move.d pc,r0 - sub.d .:GOTOFF,r0 - - move.d __libc_csu_init:PLTG,r13 - add.d r0,r13 - move.d __libc_csu_fini:PLTG,r9 - add.d r0,r9 - move.d main:PLTG,r10 - add.d r0,r10 -#else - move.d __libc_csu_init,r13 - move.d __libc_csu_fini,r9 - move.d main,r10 -#endif - push r9 - - /* Call the user's main function, and exit with its value. But - let the libc call main. */ - PLTCALL (__libc_start_main) - - /* Crash if somehow `exit' does return. We have at least 8192 - invalid addresses to choose from. */ - test.d [6502] - - /* Stop the unstoppable. */ -0: - ba 0b - nop - -/* 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/ports/sysdeps/cris/machine-gmon.h b/ports/sysdeps/cris/machine-gmon.h deleted file mode 100644 index 2f36a34d6..000000000 --- a/ports/sysdeps/cris/machine-gmon.h +++ /dev/null @@ -1,28 +0,0 @@ -/* PowerPC-specific implementation of profiling support. - 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. */ - -void __mcount_internal (unsigned long frompc, unsigned long selfpc); - -#define _MCOUNT_DECL(frompc, selfpc) \ -void __mcount_internal (unsigned long frompc, unsigned long selfpc) - - -/* Define MCOUNT as empty since we have the implementation in another - file. FIXME: Just stubs, currently. */ -#define MCOUNT diff --git a/ports/sysdeps/cris/memcopy.h b/ports/sysdeps/cris/memcopy.h deleted file mode 100644 index 134d36121..000000000 --- a/ports/sysdeps/cris/memcopy.h +++ /dev/null @@ -1,57 +0,0 @@ -/* 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. */ - -#include <sysdeps/generic/memcopy.h> - -/* We override the word-copying macros, partly because misalignment in one - pointer isn't cause for a special function, partly because we want to - get rid of wordcopy.c; these macros are only used in memmove.c (and - it's sibling bcopy) since we have arch-specific mempcpy, memcpy and - memset. */ - -#undef OP_T_THRES -#define OP_T_THRES OPSIZ - -#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \ - do \ - { \ - unsigned long enddst_bp = dst_bp + nbytes - (nbytes % OPSIZ); \ - nbytes_left = (nbytes % OPSIZ); \ - while (dst_bp < (unsigned long) enddst_bp) \ - { \ - op_t x = *(op_t *) src_bp; \ - src_bp += sizeof x; \ - *(op_t *) dst_bp = x; \ - dst_bp += sizeof x; \ - } \ - } while (0) - -#define WORD_COPY_BWD(dst_bp, src_bp, nbytes_left, nbytes) \ - do \ - { \ - unsigned long enddst_bp = dst_bp - nbytes + (nbytes % OPSIZ); \ - nbytes_left = (nbytes % OPSIZ); \ - while (dst_bp > enddst_bp) \ - { \ - op_t x; \ - src_bp -= sizeof x; \ - x = *(op_t *) src_bp; \ - dst_bp -= sizeof x; \ - *(op_t *) dst_bp = x; \ - } \ - } while (0) diff --git a/ports/sysdeps/cris/setjmp.S b/ports/sysdeps/cris/setjmp.S deleted file mode 100644 index c5a512f49..000000000 --- a/ports/sysdeps/cris/setjmp.S +++ /dev/null @@ -1,66 +0,0 @@ -/* setjmp for CRIS. - 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. */ - -#include <sysdep.h> -#define _SETJMP_H -#define _ASM -#include <bits/setjmp.h> - - .syntax no_register_prefix - -ENTRY (__sigsetjmp) -.Local__sigsetjmp: - moveq 1,r9 - movem sp,[r10+1*4] -#ifdef __PIC__ - move.d pc,r9 - addq 0f-.,r9 -#else - move.d 0f,r9 -#endif - move.d r9,[r10] - move srp,[r10+16*4] - move ccr,[r10+17*4] - PLTJUMP (__sigjmp_save) -0: /* This is where longjmp returns. (Don't use "ret" - it's a macro. */ - Ret - move.d r9,r10 -END (__sigsetjmp) - -/* Binary compatibility entry points. Having these in separate files - is not meaningful and just adds library overhead. */ - -ENTRY (__setjmp) - ba .Local__sigsetjmp - moveq 0,r11 -END (__setjmp) - -ENTRY (_setjmp) - ba .Local__sigsetjmp - moveq 0,r11 -END (_setjmp) - -ENTRY (setjmp) - ba .Local__sigsetjmp - moveq 1,r11 -END (setjmp) - -weak_extern (__setjmp) -weak_extern (_setjmp) -weak_extern (setjmp) diff --git a/ports/sysdeps/cris/sysdep.h b/ports/sysdeps/cris/sysdep.h deleted file mode 100644 index 913d5ad9b..000000000 --- a/ports/sysdeps/cris/sysdep.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Assembler macros for CRIS. - Copyright (C) 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. */ - -#include <sysdeps/generic/sysdep.h> - -#ifndef HAVE_ELF -# error ELF is assumed. Generalize the code and retry. -#endif - -#ifndef NO_UNDERSCORES -# error User-label prefix (underscore) assumed absent. Generalize the code and retry. -#endif - -#ifdef __ASSEMBLER__ - -/* Syntactic details of assembly-code. */ - -/* It is *not* generally true that "ELF uses byte-counts for .align, most - others use log2 of count of bytes", like some neighboring configs say. - See "align" in gas/read.c which is not overridden by - gas/config/obj-elf.c. It takes a log2 argument. *Some* targets - override it to take a byte argument. People should read source instead - of relying on hearsay. */ -# define ALIGNARG(log2) log2 - -# define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg -# define ASM_SIZE_DIRECTIVE(name) .size name,.-name - -/* The non-PIC jump is preferred, since it does not stall, and does not - invoke generation of a PLT. These macros assume that $r0 is set up as - GOT register. */ -# ifdef __PIC__ -# define PLTJUMP(_x) \ - add.d C_SYMBOL_NAME (_x):PLT,$pc - -# define PLTCALL(_x) \ - move.d C_SYMBOL_NAME (_x):PLTG,$r9 @ \ - add.d $r0,$r9 @ \ - jsr $r9 - -# define SETUP_PIC \ - push $r0 @ \ - move.d $pc,$r0 @ \ - sub.d .:GOTOFF,$r0 - -# define TEARDOWN_PIC pop $r0 -# else -# define PLTJUMP(_x) jump C_SYMBOL_NAME (_x) -# define PLTCALL(_x) jsr C_SYMBOL_NAME (_x) -# define SETUP_PIC -# define TEARDOWN_PIC -# endif - -/* Define an entry point visible from C. */ -# define ENTRY(name) \ - .text @ \ - ASM_GLOBAL_DIRECTIVE 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 (C_SYMBOL_NAME (name)) - -/* If compiled for profiling, call `mcount' at the start of each function. - FIXME: Note that profiling is not actually implemented. This is just - example code which might not even compile, though it is believed to be - correct. */ -# ifdef PROF -# define CALL_MCOUNT \ - push $srp @ \ - push $r9 @ \ - push $r10 @ \ - push $r11 @ \ - push $r12 @ \ - push $r13 @ \ - SETUP_PIC @ \ - PLTCALL (mcount) @ \ - TEARDOWN_PIC @ \ - pop $r13 @ \ - pop $r12 @ \ - pop $r11 @ \ - pop $r10 @ \ - pop $r9 @ \ - pop $srp -# else -# define CALL_MCOUNT /* Do nothing. */ -# endif - -/* 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 /* __ASSEMBLER__ */ diff --git a/ports/sysdeps/cris/wordcopy.c b/ports/sysdeps/cris/wordcopy.c deleted file mode 100644 index 6525e9f03..000000000 --- a/ports/sysdeps/cris/wordcopy.c +++ /dev/null @@ -1 +0,0 @@ -/* Empty; not needed. */ diff --git a/ports/sysdeps/m68k/m680x0/fpu/Makefile b/ports/sysdeps/m68k/m680x0/fpu/Makefile deleted file mode 100644 index 42db6381d..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h index 00ae07603..31d9efe35 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h +++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h @@ -1,5 +1,5 @@ /* Definitions of inline math functions implemented by the m68881/2. - Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010 + Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -175,14 +175,10 @@ __inline_mathop(__trunc, intrz) #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 diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_cos.c b/ports/sysdeps/m68k/m680x0/fpu/k_cos.c deleted file mode 100644 index dd6c215c2..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/k_cosf.c b/ports/sysdeps/m68k/m680x0/fpu/k_cosf.c deleted file mode 100644 index 2a366d094..000000000 --- a/ports/sysdeps/m68k/m680x0/fpu/k_cosf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC cosf -#define float_type float -#include <k_cos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_cosl.c b/ports/sysdeps/m68k/m680x0/fpu/k_cosl.c index 983b66544..1cc893170 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/k_cosl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/k_cosl.c @@ -1,3 +1 @@ -#define FUNC cosl -#define float_type long double -#include <k_cos.c> +/* Not needed. */ diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_sin.c b/ports/sysdeps/m68k/m680x0/fpu/k_sin.c deleted file mode 100644 index 652ca0e13..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/k_sinf.c b/ports/sysdeps/m68k/m680x0/fpu/k_sinf.c deleted file mode 100644 index 7050347c4..000000000 --- a/ports/sysdeps/m68k/m680x0/fpu/k_sinf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define FUNC sinf -#define float_type float -#include <k_sin.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_sinl.c b/ports/sysdeps/m68k/m680x0/fpu/k_sinl.c index 5a647cafd..1cc893170 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/k_sinl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/k_sinl.c @@ -1,3 +1 @@ -#define FUNC sinl -#define float_type long double -#include <k_sin.c> +/* Not needed. */ diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_tan.c b/ports/sysdeps/m68k/m680x0/fpu/k_tan.c deleted file mode 100644 index 28f6a80cf..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/k_tanf.c b/ports/sysdeps/m68k/m680x0/fpu/k_tanf.c index 777af1bf1..1cc893170 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/k_tanf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/k_tanf.c @@ -1,3 +1 @@ -#define FUNC tanf -#define float_type float -#include <k_tan.c> +/* Not needed. */ diff --git a/ports/sysdeps/m68k/m680x0/fpu/k_tanl.c b/ports/sysdeps/m68k/m680x0/fpu/k_tanl.c index f2570e681..1cc893170 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/k_tanl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/k_tanl.c @@ -1,3 +1 @@ -#define FUNC tanl -#define float_type long double -#include <k_tan.c> +/* Not needed. */ diff --git a/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps index 854c10cb1..f884644f7 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps +++ b/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps @@ -79,14 +79,16 @@ ildouble: 5 ldouble: 5 Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": double: 13 -float: 1 +float: 6 idouble: 13 -ifloat: 1 +ifloat: 6 ildouble: 6 ldouble: 6 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": double: 1 float: 1 @@ -107,6 +109,8 @@ ldouble: 1 # catanh Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -265,6 +269,125 @@ ifloat: 1 ildouble: 1 ldouble: 1 +# cos_downward +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "cos_downward (10) == -0.8390715290764524522588639478240648345199": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937": +double: 1 +idouble: 1 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344": +float: 1 +ifloat: 1 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093": +ildouble: 1 +ldouble: 1 +Test "cos_downward (9) == -0.9111302618846769883682947111811653112463": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# cos_towardzero +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199": +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241": +double: 1 +idouble: 1 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344": +float: 1 +ifloat: 1 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 + +# cos_upward +Test "cos_upward (1) == 0.5403023058681397174009366074429766037323": +float: 1 +ifloat: 1 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199": +ildouble: 1 +ldouble: 1 +Test "cos_upward (2) == -0.4161468365471423869975682295007621897660": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (3) == -0.9899924966004454572715727947312613023937": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (4) == -0.6536436208636119146391681830977503814241": +double: 1 +idouble: 1 +Test "cos_upward (5) == 0.2836621854632262644666391715135573083344": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183": +double: 1 +idouble: 1 +Test "cos_upward (8) == -0.1455000338086135258688413818311946826093": +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 @@ -272,9 +395,11 @@ 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 +ildouble: 1 +ldouble: 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 +float: 3 +ifloat: 3 ildouble: 9 ldouble: 9 Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": @@ -294,9 +419,9 @@ 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 +float: 3 idouble: 1 -ifloat: 2 +ifloat: 3 ildouble: 15 ldouble: 15 Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": @@ -366,6 +491,9 @@ ifloat: 1 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": double: 1 idouble: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": ildouble: 1 ldouble: 1 Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": @@ -376,6 +504,9 @@ ildouble: 2 ldouble: 2 # ctanh +Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": ildouble: 1 ldouble: 1 @@ -394,12 +525,73 @@ ldouble: 1 Test "erfc (0.75) == 0.288844366346484868401062165408589223": float: 1 ifloat: 1 +Test "erfc (0x1.f7303cp+1) == 2.705500297238986897105236321218861842255e-8": +ildouble: 1 +ldouble: 1 +Test "erfc (0x1.ffa002p+2) == 1.233585992097580296336099501489175967033e-29": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "erfc (0x1.ffffc8p+2) == 1.122671365033056305522366683719541099329e-29": +ildouble: 1 +ldouble: 1 Test "erfc (1.25) == 0.0770998717435417698634765188027188596": ildouble: 1 ldouble: 1 +Test "erfc (2.0) == 0.00467773498104726583793074363274707139": +float: 1 +ifloat: 1 Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 + +# exp_downward +Test "exp_downward (1) == e": +ildouble: 1 +ldouble: 1 +Test "exp_downward (2) == e^2": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "exp_downward (3) == e^3": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# exp_towardzero +Test "exp_towardzero (1) == e": +ildouble: 1 +ldouble: 1 +Test "exp_towardzero (2) == e^2": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "exp_towardzero (3) == e^3": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# exp_upward +Test "exp_upward (1) == e": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 # expm1 Test "expm1 (1) == M_El - 1.0": @@ -447,8 +639,8 @@ ifloat: 1 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": float: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "j0 (0.75) == 0.864242275166648623555731103820923211": float: 1 ifloat: 1 @@ -461,8 +653,11 @@ idouble: 1 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": float: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 +Test "j0 (8.0) == 0.171650807137553906090869407851972001": +float: 1 +ifloat: 1 # j1 Test "j1 (-1.0) == -0.440050585744933515959682203718914913": @@ -492,8 +687,8 @@ ldouble: 1 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": float: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": float: 1 ifloat: 1 @@ -506,8 +701,11 @@ idouble: 1 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": float: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 +Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": +float: 1 +ifloat: 1 Test "jn (1, -1.0) == -0.440050585744933515959682203718914913": float: 1 ifloat: 1 @@ -539,7 +737,9 @@ Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": float: 1 ifloat: 1 Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": +double: 1 float: 2 +idouble: 1 ifloat: 2 ildouble: 2 ldouble: 2 @@ -560,6 +760,11 @@ float: 2 ifloat: 2 ildouble: 1 ldouble: 1 +Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083": float: 1 ifloat: 1 @@ -578,8 +783,45 @@ ifloat: 1 ildouble: 1 ldouble: 1 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813": +float: 2 +ifloat: 2 ildouble: 1 ldouble: 1 +Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 3 +ldouble: 3 +Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2": +float: 4 +ifloat: 4 +ildouble: 1 +ldouble: 1 +Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3": +float: 5 +ifloat: 5 +Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4": +float: 4 +ifloat: 4 +ildouble: 2 +ldouble: 2 +Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4": +float: 3 +ifloat: 3 +ildouble: 2 +ldouble: 2 # lgamma Test "lgamma (-0.5) == log(2*sqrt(pi))": @@ -622,6 +864,8 @@ ldouble: 2 Test "log10 (e) == log10(e)": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 # log1p Test "log1p (-0.25) == -0.287682072451780927439219005993827432": @@ -637,6 +881,131 @@ ldouble: 1 Test "pow (0.75, 1.25) == 0.697953644326574699205914060237425566": ildouble: 1 ldouble: 1 +Test "pow (0x1p64, 0.125) == 256": +ildouble: 1 +ldouble: 1 +Test "pow (256, 8) == 0x1p64": +float: 1 +ifloat: 1 +ildouble: 7 +ldouble: 7 + +# sin_downward +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226": +ildouble: 1 +ldouble: 1 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (2) == 0.9092974268256816953960198659117448427023": +double: 1 +idouble: 1 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469": +ildouble: 1 +ldouble: 1 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (7) == 0.6569865987187890903969990915936351779369": +ildouble: 1 +ldouble: 1 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (9) == 0.4121184852417565697562725663524351793439": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# sin_towardzero +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226": +ildouble: 1 +ldouble: 1 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836": +float: 1 +ifloat: 1 +Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023": +double: 1 +idouble: 1 +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469": +ildouble: 1 +ldouble: 1 +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359": +float: 1 +ifloat: 1 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525": +float: 1 +ifloat: 1 +Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369": +ildouble: 1 +ldouble: 1 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# sin_upward +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sin_upward (10) == -0.5440211108893698134047476618513772816836": +float: 1 +ifloat: 1 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "sin_upward (3) == 0.1411200080598672221007448028081102798469": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359": +float: 1 +ifloat: 1 +Test "sin_upward (5) == -0.9589242746631384688931544061559939733525": +float: 1 +ifloat: 1 +Test "sin_upward (7) == 0.6569865987187890903969990915936351779369": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sin_upward (8) == 0.9893582466233817778081235982452886721164": +float: 1 +ifloat: 1 # sincos Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": @@ -674,6 +1043,134 @@ Test "tan (pi/4) == 1": double: 1 idouble: 1 +# tan_downward +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_downward (3) == -0.1425465430742778052956354105339134932261": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "tan_downward (4) == 1.1578212823495775831373424182673239231198": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_downward (5) == -3.3805150062465856369827058794473439087096": +ildouble: 1 +ldouble: 1 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_downward (7) == 0.8714479827243187364564508896003135663222": +double: 1 +idouble: 1 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814": +float: 1 +ifloat: 1 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087": +float: 1 +ifloat: 1 + +# tan_towardzero +Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320": +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261": +float: 1 +ifloat: 1 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312": +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222": +double: 1 +idouble: 1 +Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + +# tan_upward +Test "tan_upward (1) == 1.5574077246549022305069748074583601730873": +ildouble: 1 +ldouble: 1 +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169": +double: 1 +idouble: 1 +Test "tan_upward (2) == -2.1850398632615189916433061023136825434320": +ildouble: 1 +ldouble: 1 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261": +float: 1 +ifloat: 1 +Test "tan_upward (4) == 1.1578212823495775831373424182673239231198": +double: 1 +idouble: 1 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312": +ildouble: 1 +ldouble: 1 +Test "tan_upward (7) == 0.8714479827243187364564508896003135663222": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_upward (8) == -6.7997114552203786999252627596086333648814": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + # tgamma Test "tgamma (-0.5) == -2 sqrt (pi)": double: 1 @@ -706,16 +1203,22 @@ ildouble: 1 ldouble: 1 Test "y0 (0.75) == -0.137172769385772397522814379396581855": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 2 ldouble: 2 Test "y0 (1.0) == 0.0882569642156769579829267660235151628": ildouble: 1 ldouble: 1 Test "y0 (1.5) == 0.382448923797758843955068554978089862": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "y0 (10.0) == 0.0556711672835993914244598774101900481": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "y0 (2.0) == 0.510375672649745119596606592727157873": @@ -743,6 +1246,8 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "y1 (8.0) == -0.158060461731247494255555266187483550": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -756,16 +1261,22 @@ ildouble: 1 ldouble: 1 Test "yn (0, 0.75) == -0.137172769385772397522814379396581855": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 2 ldouble: 2 Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": ildouble: 1 ldouble: 1 Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "yn (0, 2.0) == 0.510375672649745119596606592727157873": @@ -796,6 +1307,8 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "yn (10, 0.125) == -127057845771019398.252538486899753195": @@ -888,17 +1401,17 @@ ldouble: 2 Function: Real part of "casinh": double: 6 -float: 19 +float: 1 idouble: 6 -ifloat: 19 +ifloat: 1 ildouble: 5 ldouble: 5 Function: Imaginary part of "casinh": double: 13 -float: 1 +float: 6 idouble: 13 -ifloat: 1 +ifloat: 6 ildouble: 6 ldouble: 6 @@ -913,6 +1426,8 @@ idouble: 1 ifloat: 1 Function: Real part of "catanh": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -986,19 +1501,43 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "cos_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "cos_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "cos_upward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: Real part of "cpow": double: 1 -float: 2 +float: 3 idouble: 1 -ifloat: 2 +ifloat: 3 ildouble: 15 ldouble: 15 Function: Imaginary part of "cpow": double: 2 -float: 6 +float: 5 idouble: 2 -ifloat: 6 +ifloat: 5 ildouble: 2 ldouble: 2 @@ -1025,12 +1564,16 @@ ifloat: 1 Function: Real part of "ctan": double: 1 idouble: 1 +ildouble: 2 +ldouble: 2 + +Function: Imaginary part of "ctan": ildouble: 1 ldouble: 1 -Function: Imaginary part of "ctan": -ildouble: 2 -ldouble: 2 +Function: Real part of "ctanh": +ildouble: 1 +ldouble: 1 Function: Imaginary part of "ctanh": double: 1 @@ -1046,6 +1589,28 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "exp_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "exp_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "exp_upward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 + Function: "expm1": ildouble: 1 ldouble: 1 @@ -1063,8 +1628,8 @@ double: 1 float: 1 idouble: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Function: "j1": float: 2 @@ -1077,8 +1642,8 @@ double: 1 float: 5 idouble: 1 ifloat: 5 -ildouble: 2 -ldouble: 2 +ildouble: 3 +ldouble: 3 Function: "lgamma": double: 1 @@ -1109,6 +1674,32 @@ ildouble: 1 ldouble: 1 Function: "pow": +float: 1 +ifloat: 1 +ildouble: 7 +ldouble: 7 + +Function: "sin_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "sin_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "sin_upward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1130,6 +1721,30 @@ idouble: 1 ildouble: 1 ldouble: 1 +Function: "tan_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "tan_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "tan_upward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: "tgamma": double: 1 float: 1 diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c index d272e98f2..7f1c8ab46 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c @@ -1,5 +1,5 @@ /* Complex cosine hyperbole function. m68k fpu version - Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. @@ -67,7 +67,7 @@ s(__ccosh) (__complex__ float_type x) if (rx_cond & __M81_COND_INF) __real__ retval = s(fabs) (__real__ x); else - __real__ retval = 0.0/0.0; + __real__ retval = s(__nan) (""); __imag__ retval = __imag__ x - __imag__ x; } } diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_cos.c b/ports/sysdeps/m68k/m680x0/fpu/s_cos.c index 9c9607631..2f1adf77f 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_cos.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_cos.c @@ -1,2 +1,2 @@ #define FUNC cos -#include <s_atan.c> +#include <s_sin.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_cosf.c b/ports/sysdeps/m68k/m680x0/fpu/s_cosf.c index db965b8cc..b6d6accb4 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_cosf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_cosf.c @@ -1,2 +1,2 @@ -#define FUNC cosf -#include <s_atanf.c> +#define FUNC cosf +#include <s_sinf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_cosl.c b/ports/sysdeps/m68k/m680x0/fpu/s_cosl.c index 4198feef1..eb61521fd 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_cosl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_cosl.c @@ -1,2 +1,2 @@ #define FUNC cosl -#include <s_atanl.c> +#include <s_sinl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c b/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c index 1ef99e21c..3db6f2d16 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c @@ -1,2 +1,44 @@ -#define FUNC expm1 -#include <s_atan.c> +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along 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 <errno.h> +#include "mathimpl.h" + +#ifndef FUNC +# define FUNC expm1 +#endif +#ifndef float_type +# define float_type double +#endif +#ifndef o_threshold +# define o_threshold 7.09782712893383973096e+02 +#endif + +#define CONCATX(a,b) __CONCAT(a,b) + +float_type +CONCATX(__,FUNC) (float_type x) +{ + if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold)) + __set_errno (ERANGE); + return __m81_u(CONCATX(__, FUNC)) (x); +} + +#define weak_aliasx(a, b) weak_alias(a, b) +weak_aliasx (CONCATX(__, FUNC), FUNC) diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_expm1f.c b/ports/sysdeps/m68k/m680x0/fpu/s_expm1f.c index 84935b1b4..2cd8ffcfe 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_expm1f.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_expm1f.c @@ -1,2 +1,4 @@ -#define FUNC expm1f -#include <s_atanf.c> +#define FUNC expm1f +#define float_type float +#define o_threshold 8.8722831726e+01F +#include <s_expm1.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_expm1l.c b/ports/sysdeps/m68k/m680x0/fpu/s_expm1l.c index feee07a1d..a2c80860b 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_expm1l.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_expm1l.c @@ -1,3 +1,6 @@ -#define FUNC expm1l -#include <s_atanl.c> +#define FUNC expm1l +#define float_type long double +/* 400c0000b17217f7d1cf79ab */ +#define o_threshold 1.13565234062941439487914863093465101e+04L +#include <s_expm1.c> libm_hidden_def (__expm1l) diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_sin.c b/ports/sysdeps/m68k/m680x0/fpu/s_sin.c index 0d4abdbfe..e088b584b 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_sin.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_sin.c @@ -1,2 +1,41 @@ -#define FUNC sin -#include <s_atan.c> +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along 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 <errno.h> +#include "mathimpl.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(__,FUNC) (float_type x) +{ + if (__m81_test (x) & __M81_COND_INF) + __set_errno (EDOM); + return __m81_u(CONCATX(__, FUNC)) (x); +} + +#define weak_aliasx(a, b) weak_alias(a, b) +weak_aliasx (CONCATX(__, FUNC), FUNC) diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_sinf.c b/ports/sysdeps/m68k/m680x0/fpu/s_sinf.c index 9b23d4823..304f4f76f 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_sinf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_sinf.c @@ -1,2 +1,5 @@ -#define FUNC sinf -#include <s_atanf.c> +#ifndef FUNC +# define FUNC sinf +#endif +#define float_type float +#include <s_sin.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_sinl.c b/ports/sysdeps/m68k/m680x0/fpu/s_sinl.c index 9ac532cb4..31dac0bee 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_sinl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_sinl.c @@ -1,2 +1,5 @@ -#define FUNC sinl -#include <s_atanl.c> +#ifndef FUNC +# define FUNC sinl +#endif +#define float_type long double +#include <s_sin.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_tan.c b/ports/sysdeps/m68k/m680x0/fpu/s_tan.c index ca7fb0e6d..dfbbbb227 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_tan.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_tan.c @@ -1,2 +1,2 @@ #define FUNC tan -#include <s_atan.c> +#include <s_sin.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_tanf.c b/ports/sysdeps/m68k/m680x0/fpu/s_tanf.c index 95fe9c71a..9ae66ddbf 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_tanf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_tanf.c @@ -1,2 +1,2 @@ -#define FUNC tanf -#include <s_atanf.c> +#define FUNC tanf +#include <s_sinf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_tanl.c b/ports/sysdeps/m68k/m680x0/fpu/s_tanl.c index 64fcb5440..27daf8f29 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_tanl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_tanl.c @@ -1,2 +1,2 @@ #define FUNC tanl -#include <s_atanl.c> +#include <s_sinl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/switch/68881-sw.h b/ports/sysdeps/m68k/m680x0/fpu/switch/68881-sw.h deleted file mode 100644 index c5a0f71fa..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/switch/Makefile b/ports/sysdeps/m68k/m680x0/fpu/switch/Makefile deleted file mode 100644 index c04107163..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/switch/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/switch/bits/mathinline.h deleted file mode 100644 index c0f696698..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/m68k/m680x0/fpu/switch/switch.c b/ports/sysdeps/m68k/m680x0/fpu/switch/switch.c deleted file mode 100644 index e0558176d..000000000 --- a/ports/sysdeps/m68k/m680x0/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/ports/sysdeps/powerpc/nofpu/libm-test-ulps b/ports/sysdeps/powerpc/nofpu/libm-test-ulps index e996f4ff1..49e484df4 100644 --- a/ports/sysdeps/powerpc/nofpu/libm-test-ulps +++ b/ports/sysdeps/powerpc/nofpu/libm-test-ulps @@ -11,6 +11,9 @@ ildouble: 2 ldouble: 2 # atan2 +Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112": +ildouble: 1 +ldouble: 1 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": float: 3 ifloat: 3 @@ -22,9 +25,6 @@ float: 1 ifloat: 1 ildouble: 1 ldouble: 1 -Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112": -ildouble: 1 -ldouble: 1 # atanh Test "atanh (0.75) == 0.972955074527656652552676371721589865": @@ -49,6 +49,9 @@ idouble: 1 ifloat: 1 # casin +Test "Real part of: casin (-2 - 3 i) == -0.57065278432109940071028387968566963 - 1.9833870299165354323470769028940395 i": +ildouble: 1 +ldouble: 1 Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": double: 1 float: 1 @@ -56,9 +59,6 @@ idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 -Test "Real part of: casin (-2 - 3 i) == -0.57065278432109940071028387968566963 - 1.9833870299165354323470769028940395 i": -ildouble: 1 -ldouble: 1 # casinh Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": @@ -156,8 +156,6 @@ ldouble: 1 Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": float: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 ildouble: 2 ldouble: 2 @@ -165,14 +163,14 @@ ldouble: 2 Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": float: 1 ifloat: 1 -Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -ildouble: 1 -ldouble: 1 Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": float: 1 ifloat: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": +ildouble: 1 +ldouble: 1 # clog Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i": @@ -191,15 +189,15 @@ ldouble: 1 # clog10 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": double: 1 +float: 1 idouble: 1 +ifloat: 1 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": double: 1 float: 5 @@ -208,75 +206,75 @@ ifloat: 5 ildouble: 1 ldouble: 1 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": double: 1 +float: 1 idouble: 1 +ifloat: 1 Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i": +double: 1 float: 1 +idouble: 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 double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": double: 1 +float: 1 idouble: 1 +ifloat: 1 Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": float: 1 ifloat: 1 ildouble: 3 ldouble: 3 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": float: 1 -ifloat: 1 -double: 1 idouble: 1 -Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": -float: 1 ifloat: 1 +Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": double: 1 -idouble: 1 -Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": float: 1 +idouble: 1 ifloat: 1 +Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": double: 1 +float: 1 idouble: 1 -Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i": +ifloat: 1 +Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": double: 1 +float: 1 idouble: 1 +ifloat: 1 # cos Test "cos (M_PI_6l * 2.0) == 0.5": @@ -349,18 +347,18 @@ ldouble: 2 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": double: 1 idouble: 1 -ldouble: 1 ildouble: 1 +ldouble: 1 Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 -ldouble: 1 ildouble: 1 +ldouble: 1 Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 -ldouble: 1 ildouble: 1 +ldouble: 1 # csqrt Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": @@ -450,10 +448,10 @@ Test "expm1 (0.75) == 1.11700001661267466854536981983709561": double: 1 idouble: 1 Test "expm1 (1) == M_El - 1.0": -float: 1 -ifloat: 1 double: 1 +float: 1 idouble: 1 +ifloat: 1 # hypot Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": @@ -474,15 +472,15 @@ ifloat: 1 Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": float: 1 ifloat: 1 +Test "hypot (0.75, 1.25) == 1.45773797371132511771853821938639577": +ildouble: 1 +ldouble: 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.75, 1.25) == 1.45773797371132511771853821938639577": -ildouble: 1 -ldouble: 1 # j0 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": @@ -658,16 +656,16 @@ Test "log10 (e) == log10(e)": float: 1 ifloat: 1 -# log2 -Test "log2 (e) == M_LOG2El": -ldouble: 1 -ildouble: 1 - # log1p Test "log1p (-0.25) == -0.287682072451780927439219005993827432": float: 1 ifloat: 1 +# log2 +Test "log2 (e) == M_LOG2El": +ildouble: 1 +ldouble: 1 + # sincos Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": double: 1 @@ -697,8 +695,8 @@ ldouble: 1 Test "tan (pi/4) == 1": double: 1 idouble: 1 -ldouble: 1 ildouble: 1 +ldouble: 1 # tanh Test "tanh (-0.75) == -0.635148952387287319214434357312496495": diff --git a/ports/sysdeps/unix/sysv/linux/alpha/Versions b/ports/sysdeps/unix/sysv/linux/alpha/Versions index 5a617b4be..b3cec3a75 100644 --- a/ports/sysdeps/unix/sysv/linux/alpha/Versions +++ b/ports/sysdeps/unix/sysv/linux/alpha/Versions @@ -81,6 +81,10 @@ libc { #errlist-compat 139 _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; } + GLIBC_2.16 { + #errlist-compat 140 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } GLIBC_PRIVATE { __libc_alpha_cache_shape; } diff --git a/ports/sysdeps/unix/sysv/linux/cris/vfork.S b/ports/sysdeps/unix/sysv/linux/alpha/bits/epoll.h index 74a855676..7f9f37497 100644 --- a/ports/sysdeps/unix/sysv/linux/cris/vfork.S +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#ifndef _SYS_EPOLL_H +# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." +#endif -PSEUDO (__vfork, vfork, 0) - Ret - nop -PSEUDO_END (__vfork) -libc_hidden_def (__vfork) - -weak_alias (__vfork, vfork) +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 010000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 000000004 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h index 8b2f152a1..5c72a56cd 100644 --- a/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h @@ -1,5 +1,5 @@ /* Error constants. Linux/Alpha specific version. - Copyright (C) 1996,1997,1998,1999,2002,2005 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1998,1999,2002,2005,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,6 +37,14 @@ # define ENOTRECOVERABLE 137 # endif +# ifndef ERFKILL +# define ERFKILL 138 +# endif + +# ifndef EHWPOISON +# define EHWPOISON 139 +# endif + # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); diff --git a/ports/sysdeps/cris/memusage.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h index 58b57ff37..f04833d3f 100644 --- a/ports/sysdeps/cris/memusage.h +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2008-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -/* No asm variables, just for reasons of solid healthy paranoia. */ -#define GETSP() \ - ({ \ - uintptr_t stack_ptr; \ - __asm__ ("move.d $sp,%0" : "=rm" (stack_ptr)); \ - stack_ptr; \ - }) +#ifndef _SYS_TIMERFD_H +# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." +#endif -#include <sysdeps/generic/memusage.h> +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 010000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 000000004 +#define TFD_NONBLOCK TFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/epoll.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/epoll.h deleted file mode 100644 index 9f983a515..000000000 --- a/ports/sysdeps/unix/sysv/linux/alpha/sys/epoll.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along 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_EPOLL_H -#define _SYS_EPOLL_H 1 - -#include <stdint.h> -#include <sys/types.h> - -/* Get __sigset_t. */ -#include <bits/sigset.h> - -#ifndef __sigset_t_defined -# define __sigset_t_defined -typedef __sigset_t sigset_t; -#endif - - -/* Flags to be passed to epoll_create2. */ -enum - { - EPOLL_CLOEXEC = 010000000, -#define EPOLL_CLOEXEC EPOLL_CLOEXEC - EPOLL_NONBLOCK = 04 -#define EPOLL_NONBLOCK EPOLL_NONBLOCK - }; - - -enum EPOLL_EVENTS - { - EPOLLIN = 0x001, -#define EPOLLIN EPOLLIN - EPOLLPRI = 0x002, -#define EPOLLPRI EPOLLPRI - EPOLLOUT = 0x004, -#define EPOLLOUT EPOLLOUT - EPOLLRDNORM = 0x040, -#define EPOLLRDNORM EPOLLRDNORM - EPOLLRDBAND = 0x080, -#define EPOLLRDBAND EPOLLRDBAND - EPOLLWRNORM = 0x100, -#define EPOLLWRNORM EPOLLWRNORM - EPOLLWRBAND = 0x200, -#define EPOLLWRBAND EPOLLWRBAND - EPOLLMSG = 0x400, -#define EPOLLMSG EPOLLMSG - EPOLLERR = 0x008, -#define EPOLLERR EPOLLERR - EPOLLHUP = 0x010, -#define EPOLLHUP EPOLLHUP - EPOLLRDHUP = 0x2000, -#define EPOLLRDHUP EPOLLRDHUP - EPOLLONESHOT = (1 << 30), -#define EPOLLONESHOT EPOLLONESHOT - EPOLLET = (1 << 31) -#define EPOLLET EPOLLET - }; - - -/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ -#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ -#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ -#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ - - -typedef union epoll_data -{ - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -struct epoll_event -{ - uint32_t events; /* Epoll events */ - epoll_data_t data; /* User data variable */ -}; - - -__BEGIN_DECLS - -/* Creates an epoll instance. Returns an fd for the new instance. - The "size" parameter is a hint specifying the number of file - descriptors to be associated with the new instance. The fd - returned by epoll_create() should be closed with close(). */ -extern int epoll_create (int __size) __THROW; - -/* Same as epoll_create but with an additional FLAGS parameter. */ -extern int epoll_create2 (int __size, int __flags) __THROW; - - -/* Manipulate an epoll instance "epfd". Returns 0 in case of success, - -1 in case of error ( the "errno" variable will contain the - specific error code ) The "op" parameter is one of the EPOLL_CTL_* - constants defined above. The "fd" parameter is the target of the - operation. The "event" parameter describes which events the caller - is interested in and any associated user data. */ -extern int epoll_ctl (int __epfd, int __op, int __fd, - struct epoll_event *__event) __THROW; - - -/* Wait for events on an epoll instance "epfd". Returns the number of - triggered events returned in "events" buffer. Or -1 in case of - error with the "errno" variable set to the specific error code. The - "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). - - 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); - - -/* Same as epoll_wait, but the thread's signal mask is temporarily - and atomically replaced with the one provided as parameter. - - This function is a cancellation point and therefore not marked with - __THROW. */ -extern int epoll_pwait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout, - __const __sigset_t *__ss); - -__END_DECLS - -#endif /* sys/epoll.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h deleted file mode 100644 index 09d6ccf6c..000000000 --- a/ports/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along 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_TIMERFD_H -#define _SYS_TIMERFD_H 1 - -#include <time.h> - - -/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ -enum - { - TFD_CLOEXEC = 010000000, -#define TFD_CLOEXEC TFD_CLOEXEC - TFD_NONBLOCK = 04 -#define TFD_NONBLOCK TFD_NONBLOCK - }; - - -/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */ -enum - { - TFD_TIMER_ABSTIME = 1 << 0 -#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME - }; - - -__BEGIN_DECLS - -/* Return file descriptor for new interval timer source. */ -extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW; - -/* Set next expiration time of interval timer source UFD to UTMR. If - FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is - absolute. Optionally return the old expiration time in OTMR. */ -extern int timerfd_settime (int __ufd, int __flags, - __const struct itimerspec *__utmr, - struct itimerspec *__otmr) __THROW; - -/* Return the next expiration time of UFD. */ -extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; - -__END_DECLS - -#endif /* sys/timerfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c b/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c index 51a2a4798..5623328c9 100644 --- a/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c +++ b/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2012 Free Software 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,7 @@ __sysconf (int name) if (shape <= 0) return shape; - switch (name % 3) + switch ((name - _SC_LEVEL1_ICACHE_SIZE) % 3) { case 0: /* total size */ return shape & -0x100; diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h index e1b115c8c..bb186aec0 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,11 +38,15 @@ typedef unsigned long int pthread_t; -typedef union +union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; -} pthread_attr_t; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif typedef struct __pthread_internal_slist diff --git a/ports/sysdeps/unix/sysv/linux/cris/_G_config.h b/ports/sysdeps/unix/sysv/linux/cris/_G_config.h deleted file mode 100644 index 083a00abf..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/_G_config.h +++ /dev/null @@ -1,106 +0,0 @@ -/* This file is needed by libio to define various configuration parameters. - These are always the same in the GNU C library. */ - -/* We have to keep a separate copy for CRIS, because we don't use thunks, - and libstdc++-v2 (which we currently use) cares. The C++ ABI is - changed totally with GCC 3.0, where we should not need a separate file. */ - -#ifndef _G_config_h -#define _G_config_h 1 - -/* Define types for libio in terms of the standard internal type names. */ - -#include <bits/types.h> -#define __need_size_t -#define __need_wchar_t -#define __need_wint_t -#define __need_NULL -#include <stddef.h> -#ifndef _WINT_T -/* Integral type unchanged by default argument promotions that can - hold any value corresponding to members of the extended character - set, as well as at least one value that does not correspond to any - member of the extended character set. */ -# define _WINT_T -typedef unsigned int wint_t; -#endif -#define __need_mbstate_t -#include <wchar.h> -#define _G_size_t size_t -typedef struct -{ - __off_t __pos; - __mbstate_t __state; -} _G_fpos_t; -typedef struct -{ - __off64_t __pos; - __mbstate_t __state; -} _G_fpos64_t; -#define _G_ssize_t __ssize_t -#define _G_off_t __off_t -#define _G_off64_t __off64_t -#define _G_pid_t __pid_t -#define _G_uid_t __uid_t -#define _G_wchar_t wchar_t -#define _G_wint_t wint_t -#define _G_stat64 stat64 -#include <gconv.h> -typedef union -{ - struct __gconv_info __cd; - struct - { - struct __gconv_info __cd; - struct __gconv_step_data __data; - } __combined; -} _G_iconv_t; - -typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); -typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); -typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); -typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); - -#define _G_HAVE_BOOL 1 - - -/* These library features are always available in the GNU C library. */ -#define _G_HAVE_ATEXIT 1 -#define _G_HAVE_SYS_CDEFS 1 -#define _G_HAVE_SYS_WAIT 1 -#define _G_NEED_STDARG_H 1 -#define _G_va_list __gnuc_va_list - -#define _G_HAVE_PRINTF_FP 1 -#define _G_HAVE_MMAP 1 -#define _G_HAVE_LONG_DOUBLE_IO 1 -#define _G_HAVE_IO_FILE_OPEN 1 -#define _G_HAVE_IO_GETLINE_INFO 1 - -#define _G_IO_IO_FILE_VERSION 0x20001 - -#define _G_OPEN64 __open64 -#define _G_LSEEK64 __lseek64 -#define _G_MMAP64 __mmap64 -#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf) - -/* This is defined by <bits/stat.h> if `st_blksize' exists. */ -#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) - -#define _G_BUFSIZ 8192 - -/* These are the vtbl details for ELF. */ -#define _G_NAMES_HAVE_UNDERSCORE 0 -#define _G_VTABLE_LABEL_HAS_LENGTH 1 -#undef _G_USING_THUNKS -#define _G_VTABLE_LABEL_PREFIX "_vt." -#define _G_VTABLE_LABEL_PREFIX_ID _vt. - - -#if defined __cplusplus || defined __STDC__ -# define _G_ARGS(ARGLIST) ARGLIST -#else -# define _G_ARGS(ARGLIST) () -#endif - -#endif /* _G_config.h */ diff --git a/ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h deleted file mode 100644 index e14ca2536..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/bits/fcntl.h +++ /dev/null @@ -1,191 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 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 _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_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. */ -#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 0100000 -#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. */ -# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with - close-on-exit set. */ -#endif - -/* For F_[GET|SET]FD. */ -#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/ports/sysdeps/unix/sysv/linux/cris/bits/mman.h b/ports/sysdeps/unix/sysv/linux/cris/bits/mman.h deleted file mode 100644 index b66c0bdb6..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/bits/mman.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux/CRIS version. - Copyright (C) 1997, 2000, 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. */ - -#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 0x0100 /* Stack-like segment. */ -# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ -# define MAP_LOCKED 0x2000 /* Lock the mapping. */ -# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ -#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 -#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. */ -#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/ports/sysdeps/unix/sysv/linux/cris/brk.c b/ports/sysdeps/unix/sysv/linux/cris/brk.c deleted file mode 100644 index ce4944512..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/brk.c +++ /dev/null @@ -1,44 +0,0 @@ -/* brk system call for Linux/CRIS. - Copyright (C) 1995, 1996, 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 <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) -{ - unsigned char *newbrk; - - newbrk = (unsigned char *) INLINE_SYSCALL (brk, 1, addr); - - __curbrk = newbrk; - - if (newbrk < (unsigned char *) addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/cris/chown.c b/ports/sysdeps/unix/sysv/linux/cris/chown.c deleted file mode 100644 index 196162256..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/chown.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/m68k/chown.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/clone.S b/ports/sysdeps/unix/sysv/linux/cris/clone.S deleted file mode 100644 index b2016438a..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/clone.S +++ /dev/null @@ -1,88 +0,0 @@ -/* 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. */ - -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - - .syntax no_register_prefix - - .text -ENTRY (__clone) - /* Sanity check arguments: No NULL function pointers. Allow a NULL - stack pointer though; it makes the kernel allocate stack. */ - test.d r10 - beq 1f - nop - - /* We need to muck with a few registers. */ - movem r1,[sp=sp-8] - - /* Save the function pointer and argument. We can't save them - onto the new stack since it can be NULL. */ - move.d r10,r0 - move.d r13,r1 - - /* Move the other arguments into place for the system call. */ - move.d r11,r10 - move.d r12,r11 - - /* Do the system call. */ - movu.w SYS_ify (clone),r9 - break 13 - test.d r10 - beq .Lthread_start - nop - - /* Jump to error handler if we get (unsigned) -4096 .. 0xffffffff. */ - cmps.w -4096,r10 - bhs 0f - movem [sp+],r1 - - /* In parent, successful return. (Avoid using "ret" - it's a macro.) */ - Ret - nop - -.Lthread_start: - /* Terminate frame pointers here. */ - moveq 0,r8 - - /* I've told you once. */ - move.d r1,r10 - jsr r0 - - SETUP_PIC - PLTCALL (_exit) - - /* Die horribly. */ - test.d [6809] - - /* Stop the unstoppable. */ -9: - ba 9b - nop - -/* Local error handler. */ -1: - movs.w -EINVAL,r10 - /* Drop through into the ordinary error handler. */ -PSEUDO_END (__clone) - -weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/cris/fchown.c b/ports/sysdeps/unix/sysv/linux/cris/fchown.c deleted file mode 100644 index 3a69ecc9e..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/fchown.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/fcntl.c b/ports/sysdeps/unix/sysv/linux/cris/fcntl.c deleted file mode 100644 index ea951bc4f..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/fcntl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/fxstat.c b/ports/sysdeps/unix/sysv/linux/cris/fxstat.c deleted file mode 100644 index 4f219f0b9..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/fxstat.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getegid.c b/ports/sysdeps/unix/sysv/linux/cris/getegid.c deleted file mode 100644 index 37b4b4a53..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getegid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/geteuid.c b/ports/sysdeps/unix/sysv/linux/cris/geteuid.c deleted file mode 100644 index ebcb555b5..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/geteuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/geteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getgid.c b/ports/sysdeps/unix/sysv/linux/cris/getgid.c deleted file mode 100644 index 0a4d6061f..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getgroups.c b/ports/sysdeps/unix/sysv/linux/cris/getgroups.c deleted file mode 100644 index 102ea24e1..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/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/ports/sysdeps/unix/sysv/linux/cris/getresgid.c b/ports/sysdeps/unix/sysv/linux/cris/getresgid.c deleted file mode 100644 index b703a414c..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getresgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getresuid.c b/ports/sysdeps/unix/sysv/linux/cris/getresuid.c deleted file mode 100644 index 0b14cefe3..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getresuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getrlimit.c b/ports/sysdeps/unix/sysv/linux/cris/getrlimit.c deleted file mode 100644 index fc06dbd64..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getrlimit64.c b/ports/sysdeps/unix/sysv/linux/cris/getrlimit64.c deleted file mode 100644 index fef018f47..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/getuid.c b/ports/sysdeps/unix/sysv/linux/cris/getuid.c deleted file mode 100644 index d682c79a4..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/getuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/lchown.c b/ports/sysdeps/unix/sysv/linux/cris/lchown.c deleted file mode 100644 index c89de99ba..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/lchown.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/lockf64.c b/ports/sysdeps/unix/sysv/linux/cris/lockf64.c deleted file mode 100644 index a88f5a784..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/lockf64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/lxstat.c b/ports/sysdeps/unix/sysv/linux/cris/lxstat.c deleted file mode 100644 index 2371cd971..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/lxstat.c +++ /dev/null @@ -1,2 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lxstat.c> - diff --git a/ports/sysdeps/unix/sysv/linux/cris/mmap.S b/ports/sysdeps/unix/sysv/linux/cris/mmap.S deleted file mode 100644 index 3c74d590f..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/mmap.S +++ /dev/null @@ -1,68 +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. */ - -#include <sysdep.h> - -#include "kernel-features.h" - -#include <asm/errno.h> - -/* Rather than dragging in yet another kernel file, <asm/page.h>, we - define it here. Provide for easy override. */ -#ifndef PAGE_SHIFT -#define PAGE_SHIFT 13 -#endif - - .syntax no_register_prefix - -/* This is __ptr_t - __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) */ - - ENTRY (__mmap) - - /* Only accept a offset (and address) being a multiple of PAGE_SIZE, - since we only pass the page part in the system call. */ - move.d [sp+4],r9 - btstq (PAGE_SHIFT - 1),r9 - bne 1f - btstq (PAGE_SHIFT - 1),r10 - - bne 1f - lsrq PAGE_SHIFT,r9 - - move [sp],mof - move srp,[sp] - move r9,srp - - movu.b SYS_ify (mmap2),r9 - break 13 - - cmps.w -4096,r10 - bhs 0f - move [sp],srp - - Ret - nop - -/* Local error handler. */ -1: - movs.w -EINVAL,r10 - /* Drop through into the ordinary error handler. */ -PSEUDO_END (__mmap) - -weak_alias (__mmap, mmap) diff --git a/ports/sysdeps/unix/sysv/linux/cris/mmap64.S b/ports/sysdeps/unix/sysv/linux/cris/mmap64.S deleted file mode 100644 index d71114454..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/mmap64.S +++ /dev/null @@ -1,91 +0,0 @@ -/* 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. */ - -#include <sysdep.h> - -#include "kernel-features.h" - -#include <asm/errno.h> - -/* Rather than dragging in yet another kernel file, <asm/page.h>, we - define it here. Provide for easy override. */ -#ifndef PAGE_SHIFT -#define PAGE_SHIFT 13 -#endif - -/* This is: __ptr_t - __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, - off64_t offset); */ - -/* This was done in C, but the resulting code didn't look anywhere near - nice, and mmap64 is important enough to have fast code. Rather than - fixing (the generic bits in) gcc, we make sure not to depend on it by - writing code that GCC cannot reasonably generate. */ - - .syntax no_register_prefix - -ENTRY (__mmap64) - - move [sp],mof - move.d [sp+4],r9 - - /* Only accept an offset being a multiple of PAGE_SIZE, ditto address. */ - btstq (PAGE_SHIFT - 1),r9 - bne 1f - lsrq PAGE_SHIFT,r9 - - btstq (PAGE_SHIFT - 1),r10 - bne 1f - move.d r9,[sp] - - /* We have to store the adjusted part somewhere we can "or" from. - No registers available, so let's re-use the incoming low-part - parameter location. */ - move.d [sp+8],r9 - - swapwbr r9 - /* Check if the highest bits (now the lowest bits) are zero. They - must be, since we're actually calling a system function - specifying the size in *pages* in a single dword. Thus you can - mmap64 PAGE_SIZE * 4 Gbyte. */ - btstq (PAGE_SHIFT - 1),r9 - bne 1f - swapwbr r9 - - lslq (32 - PAGE_SHIFT),r9 - or.d [sp],r9 - move srp,[sp] - move r9,srp - - movu.b SYS_ify (mmap2),r9 - break 13 - - cmps.w -4096,r10 - bhs 0f - move [sp],srp - - Ret - nop - -/* Local error handler. */ -1: - movs.w -EINVAL,r10 - /* Drop through into the ordinary error handler. */ -PSEUDO_END (__mmap64) - -weak_alias (__mmap64, mmap64) diff --git a/ports/sysdeps/unix/sysv/linux/cris/msgctl.c b/ports/sysdeps/unix/sysv/linux/cris/msgctl.c deleted file mode 100644 index 9f9b8431a..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/msgctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/msgctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/register-dump.h b/ports/sysdeps/unix/sysv/linux/cris/register-dump.h deleted file mode 100644 index 309728bf9..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/register-dump.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Dump registers. - Copyright (C) 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. */ - -#include <stddef.h> -#include <sys/uio.h> -#include <stdio-common/_itoa.h> - -/* We will print the register dump in this format: - - R0: XXXXXXXX R1: XXXXXXXX R2: XXXXXXXX R3: XXXXXXXX - R4: XXXXXXXX R5: XXXXXXXX R6: XXXXXXXX R7: XXXXXXXX - R8: XXXXXXXX R9: XXXXXXXX R10: XXXXXXXX R11: XXXXXXXX - R12: XXXXXXXX R13: XXXXXXXX SP: XXXXXXXX PC: XXXXXXXX -DCCR: XXXXXXXX SRP: XXXXXXXX */ - -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[18][8]; - struct iovec iov[36], *next_iov = iov; - struct pt_regs *rx = &ctx->regs; - -#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 (rx->r0, regs[0], 8); - hexvalue (rx->r1, regs[1], 8); - hexvalue (rx->r2, regs[2], 8); - hexvalue (rx->r3, regs[3], 8); - hexvalue (rx->r4, regs[4], 8); - hexvalue (rx->r5, regs[5], 8); - hexvalue (rx->r6, regs[6], 8); - hexvalue (rx->r7, regs[7], 8); - hexvalue (rx->r8, regs[8], 8); - hexvalue (rx->r9, regs[9], 8); - hexvalue (rx->r10, regs[10], 8); - hexvalue (rx->r11, regs[11], 8); - hexvalue (rx->r12, regs[12], 8); - hexvalue (rx->r13, regs[13], 8); - hexvalue (ctx->usp, regs[14], 8); - hexvalue (rx->irp, regs[17], 8); - hexvalue (rx->dccr, regs[15], 8); - hexvalue (rx->srp, regs[16], 8); - - /* Generate the output. */ - ADD_STRING ("Register dump:\n\n R0: "); - ADD_MEM (regs[0], 8); - ADD_STRING (" R1: "); - ADD_MEM (regs[1], 8); - ADD_STRING (" R2: "); - ADD_MEM (regs[2], 8); - ADD_STRING (" R3: "); - ADD_MEM (regs[3], 8); - ADD_STRING ("\n R4: "); - ADD_MEM (regs[4], 8); - ADD_STRING (" R5: "); - ADD_MEM (regs[5], 8); - ADD_STRING (" R6: "); - ADD_MEM (regs[6], 8); - ADD_STRING (" R7: "); - ADD_MEM (regs[7], 8); - ADD_STRING ("\n R8: "); - ADD_MEM (regs[8], 8); - ADD_STRING (" R9: "); - ADD_MEM (regs[9], 8); - ADD_STRING (" R10: "); - ADD_MEM (regs[10], 8); - ADD_STRING (" R11: "); - ADD_MEM (regs[11], 8); - ADD_STRING ("\n R12: "); - ADD_MEM (regs[12], 8); - ADD_STRING (" R13: "); - ADD_MEM (regs[13], 8); - ADD_STRING (" SP: "); - ADD_MEM (regs[14], 8); - ADD_STRING (" PC: "); - ADD_MEM (regs[17], 8); - ADD_STRING ("\nDCCR: "); - ADD_MEM (regs[15], 8); - ADD_STRING (" SRP: "); - ADD_MEM (regs[16], 4); - - /* Write the stuff out. */ - writev (fd, iov, next_iov - iov); -} - -#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/cris/semctl.c b/ports/sysdeps/unix/sysv/linux/cris/semctl.c deleted file mode 100644 index e9b1a483c..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/semctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/semctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setegid.c b/ports/sysdeps/unix/sysv/linux/cris/setegid.c deleted file mode 100644 index 2e3a54c89..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setegid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/seteuid.c b/ports/sysdeps/unix/sysv/linux/cris/seteuid.c deleted file mode 100644 index 18e41d08c..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/seteuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/seteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setfsgid.c b/ports/sysdeps/unix/sysv/linux/cris/setfsgid.c deleted file mode 100644 index 088671256..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setfsgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setfsgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setfsuid.c b/ports/sysdeps/unix/sysv/linux/cris/setfsuid.c deleted file mode 100644 index a9f22eb8a..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setfsuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setfsuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setgid.c b/ports/sysdeps/unix/sysv/linux/cris/setgid.c deleted file mode 100644 index 377021d9e..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setgroups.c b/ports/sysdeps/unix/sysv/linux/cris/setgroups.c deleted file mode 100644 index 0e7086278..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/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/ports/sysdeps/unix/sysv/linux/cris/setregid.c b/ports/sysdeps/unix/sysv/linux/cris/setregid.c deleted file mode 100644 index 99c57ad20..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setregid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setregid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setresgid.c b/ports/sysdeps/unix/sysv/linux/cris/setresgid.c deleted file mode 100644 index daca1a483..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setresgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setresuid.c b/ports/sysdeps/unix/sysv/linux/cris/setresuid.c deleted file mode 100644 index 3aeabe9ad..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setresuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setreuid.c b/ports/sysdeps/unix/sysv/linux/cris/setreuid.c deleted file mode 100644 index 8ad61226e..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setreuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setreuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setrlimit.c b/ports/sysdeps/unix/sysv/linux/cris/setrlimit.c deleted file mode 100644 index bfaef74c3..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/setuid.c b/ports/sysdeps/unix/sysv/linux/cris/setuid.c deleted file mode 100644 index de394379b..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/setuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/shmctl.c b/ports/sysdeps/unix/sysv/linux/cris/shmctl.c deleted file mode 100644 index 7eac6380d..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/shmctl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/shmctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/cris/socket.S b/ports/sysdeps/unix/sysv/linux/cris/socket.S deleted file mode 100644 index 38b4ac5fb..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/socket.S +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 1995, 1996, 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 <sysdep.h> -#include <socketcall.h> - -#define P(a, b) P2(a, b) -#define P2(a, b) a##b - -/* 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. - They also #define a 'number-of-arguments' word in NARGS, which - defaults to 3. */ - -#ifndef NARGS -#ifdef socket -#error NARGS not defined -#endif -#define NARGS 3 -#endif - - .syntax no_register_prefix - -#ifndef __socket -#define __socket P(__,socket) -#endif - -ENTRY(__socket) - subq NARGS*4,sp - -#if NARGS >= 2 - move.d sp,r9 - move.d r10,[r9+] -#else - move.d r10,[sp] -#endif -#if NARGS >= 2 - move.d r11,[r9+] -#endif -#if NARGS >= 3 - move.d r12,[r9+] -#endif -#if NARGS >= 4 - move.d r13,[r9+] -#endif -#if NARGS >= 5 - move.d [sp+NARGS*4],r13 - move.d r13,[r9+] -#endif -#if NARGS >= 6 - move.d [sp+NARGS*4+4],r13 - move.d r13,[r9+] -#endif -#if NARGS >= 7 - move.d [sp+NARGS*4+8],r13 - move.d r13,[r9+] -#endif -#if NARGS >= 8 - move.d [sp+NARGS*4+12],r13 - move.d r13,[r9+] -#endif -#if NARGS >= 9 -#error Too many arguments! -#endif - moveq P(SOCKOP_,socket),r10 - move.d sp,r11 - movu.w SYS_ify(socketcall),r9 - break 13 - cmps.w -4096,r10 - bhs 0f - addq NARGS*4,sp - Ret - nop -PSEUDO_END (__socket) - -weak_alias (__socket, socket) diff --git a/ports/sysdeps/unix/sysv/linux/cris/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/cris/sys/ucontext.h deleted file mode 100644 index 2d3aee076..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/sys/ucontext.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 1998, 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_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <signal.h> - -#include <bits/sigcontext.h> - - -/* Type for general register. */ -typedef long int greg_t; - -/* Number of general registers. */ -#define NGREG 20 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* A placeholder type for floating-point register. */ -typedef long int fpreg_t; - -/* A placeholder; CRIS does not have any fp regs. */ -typedef unsigned long fpregset_t; - -/* A machine context is exactly a sigcontext. */ -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/ports/sysdeps/unix/sysv/linux/cris/syscall.S b/ports/sysdeps/unix/sysv/linux/cris/syscall.S deleted file mode 100644 index 03626b094..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/syscall.S +++ /dev/null @@ -1,40 +0,0 @@ -/* 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. */ - -#include <sysdep.h> - - .syntax no_register_prefix - -/* Make syscall (callno, ...) into a system call. */ - -ENTRY (syscall) - move.d r10,r9 - move.d r11,r10 - move.d r12,r11 - move.d r13,r12 - move.d [sp],r13 - move srp,[sp] - move [sp+4],mof - move [sp+8],srp - break 13 - cmps.w -4096,r10 - bhs 0f - move [sp],srp - Ret - nop -PSEUDO_END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/cris/sysdep.S b/ports/sysdeps/unix/sysv/linux/cris/sysdep.S deleted file mode 100644 index e53e7bbfb..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/sysdep.S +++ /dev/null @@ -1,66 +0,0 @@ -/* 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. */ - -#include <sysdep.h> - -/* The syscall stubs jump here when they detect an error, bot for PIC and - non-PIC. */ - - .syntax no_register_prefix - -ENTRY (__syscall_error) - neg.d r10,r10 - -#ifdef _LIBC_REENTRANT - push r10 - push srp - - /* Note that __syscall_error is only visible within this library, - and no-one passes it on as a pointer, so can assume that R0 (GOT - pointer) is correctly set up. */ - PLTCALL (__errno_location) - - pop srp - pop r11 - move.d r11,[r10] - -#else /* not _LIBC_REENTRANT */ -# ifdef __PIC__ - move.d [r0+C_SYMBOL_NAME(errno:GOT)],r9 - move.d r10,[r9] -# else - move.d r10,[C_SYMBOL_NAME(errno)] -# endif -#endif /* _LIBC_REENTRANT */ - -#ifdef __PIC__ -/* PIC callers are supposed to have R0 on stack, ready for us to restore. - Callers are only allowed from within this DSO, so the GOT in r0 is the - one we want to use. - - (Don't use "ret" - it's a macro). */ - - moveq -1,r10 - Ret - pop r0 -#else - Ret - moveq -1,r10 -#endif - -END (__syscall_error) diff --git a/ports/sysdeps/unix/sysv/linux/cris/sysdep.h b/ports/sysdeps/unix/sysv/linux/cris/sysdep.h deleted file mode 100644 index 5013dd5d3..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/sysdep.h +++ /dev/null @@ -1,226 +0,0 @@ -/* Assembler macros for CRIS. - Copyright (C) 1999, 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 <asm/unistd.h> -#include <sysdeps/cris/sysdep.h> -#include <sys/syscall.h> -#include "config.h" - -#undef SYS_ify -#define SYS_ify(syscall_name) (__NR_##syscall_name) - - -#ifdef __ASSEMBLER__ - -/* 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. */ - -/* Syscall wrappers consist of - #include <sysdep.h> - PSEUDO (...) - ret - PSEUDO_END (...) - - which expand to the following. */ - -/* Linux takes system call arguments in registers: - syscall number R9 - arg 1 R10 - arg 2 R11 - arg 3 R12 - arg 4 R13 - arg 5 MOF - arg 6 SRP - - The compiler calls us by the C convention: - syscall number in the DO_CALL macro - arg 1 R10 - arg 2 R11 - arg 3 R12 - arg 4 R13 - arg 5 [SP] - arg 6 [SP + 4] - */ - -/* Note that we use "bhs", since we want to match - (unsigned) -4096 .. 0xffffffff. Using "ble" would match - -4096 .. -2**31. */ -#define PSEUDO(name, syscall_name, args) \ - ENTRY (name) @ \ - DOARGS_##args @ \ - movu.w SYS_ify (syscall_name),$r9 @ \ - break 13 @ \ - cmps.w -4096,$r10 @ \ - bhs 0f @ \ - nop @ \ - UNDOARGS_return_##args - -/* Ouch! We have to remember not to use "ret" in assembly-code. - ("Luckily", mnemonics are case-insensitive.) - Note that we assume usage is exactly: - PSEUDO (...) - ret - PSEUDO_END (...) - so we can put all payload into PSEUDO (except for error handling). */ - -#define ret - -#define PSEUDO_END(name) \ -0: @ \ - SETUP_PIC @ \ - PLTJUMP (syscall_error) @ \ - END (name) - -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - ENTRY (name) @ \ - DOARGS_##args @ \ - movu.w SYS_ify (syscall_name),$r9 @ \ - break 13 @ \ - UNDOARGS_return_##args - -#define ret_NOERRNO - -#define PSEUDO_END_NOERRNO(name) \ - END (name) - -#define DOARGS_0 -#define DOARGS_1 -#define DOARGS_2 -#define DOARGS_3 -#define DOARGS_4 -#define DOARGS_5 \ - move [$sp],$mof - -/* To avoid allocating stack-space, we re-use the arg 5 (MOF) entry by - storing SRP into it. If called with too-few arguments, we will crash, - but that will happen in the general case too. */ -#define DOARGS_6 \ - DOARGS_5 @ \ - move $srp,[$sp] @ \ - move [$sp+4],$srp - -#define UNDOARGS_return_0 \ - Ret @ \ - nop - -#define UNDOARGS_return_1 UNDOARGS_return_0 -#define UNDOARGS_return_2 UNDOARGS_return_0 -#define UNDOARGS_return_3 UNDOARGS_return_0 -#define UNDOARGS_return_4 UNDOARGS_return_0 -#define UNDOARGS_return_5 UNDOARGS_return_0 - -/* We assume the following code will be "ret" and "PSEUDO_END". */ -#define UNDOARGS_return_return_6 \ - jump [$sp] - -#else /* not __ASSEMBLER__ */ - -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ \ - unsigned long __sys_res; \ - register unsigned long __res asm ("r10"); \ - LOAD_ARGS_c_##nr (args) \ - register unsigned long __callno asm ("r9") \ - = SYS_ify (name); \ - asm volatile (LOAD_ARGS_asm_##nr (args) \ - "break 13" \ - : "=r" (__res) \ - : ASM_ARGS_##nr (args) \ - : ASM_CLOBBER_##nr); \ - __sys_res = __res; \ - \ - if (__sys_res >= (unsigned long) -4096) \ - { \ - __set_errno (- __sys_res); \ - __sys_res = (unsigned long) -1; \ - } \ - (long int) __sys_res; \ - }) - -#define LOAD_ARGS_c_0() -#define LOAD_ARGS_asm_0() -#define ASM_CLOBBER_0 "memory" -#define ASM_ARGS_0() "r" (__callno) - -#define LOAD_ARGS_c_1(r10) \ - LOAD_ARGS_c_0() \ - register unsigned long __r10 __asm__ ("r10") = (unsigned long) (r10); -#define LOAD_ARGS_asm_1(r10) LOAD_ARGS_asm_0 () -#define ASM_CLOBBER_1 ASM_CLOBBER_0 -#define ASM_ARGS_1(r10) ASM_ARGS_0 (), "0" (__r10) - -#define LOAD_ARGS_c_2(r10, r11) \ - LOAD_ARGS_c_1(r10) \ - register unsigned long __r11 __asm__ ("r11") = (unsigned long) (r11); -#define LOAD_ARGS_asm_2(r10, r11) LOAD_ARGS_asm_1 (r10) -#define ASM_CLOBBER_2 ASM_CLOBBER_1 -#define ASM_ARGS_2(r10, r11) ASM_ARGS_1 (r10), "r" (__r11) - -#define LOAD_ARGS_c_3(r10, r11, r12) \ - LOAD_ARGS_c_2(r10, r11) \ - register unsigned long __r12 __asm__ ("r12") = (unsigned long) (r12); -#define LOAD_ARGS_asm_3(r10, r11, r12) LOAD_ARGS_asm_2 (r10, r11) -#define ASM_CLOBBER_3 ASM_CLOBBER_2 -#define ASM_ARGS_3(r10, r11, r12) ASM_ARGS_2 (r10, r11), "r" (__r12) - -#define LOAD_ARGS_c_4(r10, r11, r12, r13) \ - LOAD_ARGS_c_3(r10, r11, r12) \ - register unsigned long __r13 __asm__ ("r13") = (unsigned long) (r13); -#define LOAD_ARGS_asm_4(r10, r11, r12, r13) LOAD_ARGS_asm_3 (r10, r11, r12) -#define ASM_CLOBBER_4 ASM_CLOBBER_3 -#define ASM_ARGS_4(r10, r11, r12, r13) ASM_ARGS_3 (r10, r11, r12), "r" (__r13) - -#define LOAD_ARGS_c_5(r10, r11, r12, r13, mof) \ - LOAD_ARGS_c_4(r10, r11, r12, r13) -#define LOAD_ARGS_asm_5(r10, r11, r12, r13, mof) \ - LOAD_ARGS_asm_4 (r10, r11, r12, r13) "move %6,$mof\n\t" -#define ASM_CLOBBER_5 ASM_CLOBBER_4 -#define ASM_ARGS_5(r10, r11, r12, r13, mof) \ - ASM_ARGS_4 (r10, r11, r12, r13), "g" (mof) - -#define LOAD_ARGS_c_6(r10, r11, r12, r13, mof, srp) \ - LOAD_ARGS_c_5(r10, r11, r12, r13, mof) -#define LOAD_ARGS_asm_6(r10, r11, r12, r13, mof, srp) \ - LOAD_ARGS_asm_5(r10, r11, r12, r13, mof) \ - "move %7,$srp\n\t" -#define ASM_CLOBBER_6 ASM_CLOBBER_5, "srp" -#define ASM_ARGS_6(r10, r11, r12, r13, mof, srp) \ - ASM_ARGS_5 (r10, r11, r12, r13, mof), "g" (srp) - -#endif /* not __ASSEMBLER__ */ diff --git a/ports/sysdeps/unix/sysv/linux/cris/xstat.c b/ports/sysdeps/unix/sysv/linux/cris/xstat.c deleted file mode 100644 index e9869f550..000000000 --- a/ports/sysdeps/unix/sysv/linux/cris/xstat.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h index 832609d54..588c928f7 100644 --- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. @@ -38,11 +38,15 @@ typedef unsigned long int pthread_t; -typedef union +union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; -} pthread_attr_t; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif typedef struct __pthread_internal_slist diff --git a/ports/sysdeps/unix/sysv/linux/cris/profil-counter.h b/ports/sysdeps/unix/sysv/linux/mips/bits/epoll.h index 37adc1fee..4c6eb3bb7 100644 --- a/ports/sysdeps/unix/sysv/linux/cris/profil-counter.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/epoll.h @@ -1,5 +1,4 @@ -/* Low-level statistical profiling support function. Linux/CRIS version. - Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,14 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -#include <signal.h> +#ifndef _SYS_EPOLL_H +# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." +#endif -static void -profil_counter (int signo, struct sigcontext *scp) -{ - profil_count ((void *) scp->regs.irp); -} +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 02000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 00000200 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h b/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h index 62b952cda..1cf339f0b 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h @@ -1,5 +1,5 @@ /* Error constants. MIPS/Linux specific version. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -42,6 +42,10 @@ # define ERFKILL 167 # endif +# ifndef EHWPOISON +# define EHWPOISON 168 +# endif + # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h index 484668f44..19975fb0a 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h @@ -1,6 +1,5 @@ /* siginfo_t, sigevent and constants. Linux/MIPS version. - Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2011 - Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -50,7 +49,7 @@ typedef union sigval # endif -typedef struct siginfo +typedef struct { int si_signo; /* Signal number. */ int si_code; /* Signal code. */ @@ -274,6 +273,12 @@ enum # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) # endif +/* Forward declaration. */ +# ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +# endif + typedef struct sigevent { sigval_t sigev_value; @@ -291,7 +296,7 @@ typedef struct sigevent struct { void (*_function) (sigval_t); /* Function to start. */ - void *_attribute; /* Really pthread_attr_t. */ + pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h index cfd7dd778..eac3bcd9e 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h @@ -417,6 +417,7 @@ struct linger __BEGIN_DECLS +#ifdef __USE_GNU /* Receive up to VLEN messages as described by VMESSAGES from socket FD. Returns the number of bytes read or -1 for errors. @@ -432,6 +433,7 @@ This function is a cancellation point and therefore not marked with __THROW. */ extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); +#endif __END_DECLS diff --git a/ports/sysdeps/cris/stackinfo.h b/ports/sysdeps/unix/sysv/linux/mips/bits/timerfd.h index 43c944834..032735d01 100644 --- a/ports/sysdeps/cris/stackinfo.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/timerfd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2008-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,17 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ -/* This file contains a bit of information about the stack allocation - of the processor. */ +#ifndef _SYS_TIMERFD_H +# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." +#endif -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -/* On cris the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -#endif /* stackinfo.h */ +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 02000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 00000200 +#define TFD_NONBLOCK TFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h index 166a6c6ae..a479f2dec 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -50,11 +50,15 @@ typedef unsigned long int pthread_t; -typedef union +union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; -} pthread_attr_t; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif #if _MIPS_SIM == _ABI64 diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/epoll.h b/ports/sysdeps/unix/sysv/linux/mips/sys/epoll.h deleted file mode 100644 index 05b979bc6..000000000 --- a/ports/sysdeps/unix/sysv/linux/mips/sys/epoll.h +++ /dev/null @@ -1,145 +0,0 @@ -/* Copyright (C) 2002-2006, 2007, 2008, 2011, 2012 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along 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_EPOLL_H -#define _SYS_EPOLL_H 1 - -#include <stdint.h> -#include <sys/types.h> - -/* Get __sigset_t. */ -#include <bits/sigset.h> - -#ifndef __sigset_t_defined -# define __sigset_t_defined -typedef __sigset_t sigset_t; -#endif - - -/* Flags to be passed to epoll_create1. */ -enum - { - EPOLL_CLOEXEC = 02000000, -#define EPOLL_CLOEXEC EPOLL_CLOEXEC - EPOLL_NONBLOCK = 0200 -#define EPOLL_NONBLOCK EPOLL_NONBLOCK - }; - - -enum EPOLL_EVENTS - { - EPOLLIN = 0x001, -#define EPOLLIN EPOLLIN - EPOLLPRI = 0x002, -#define EPOLLPRI EPOLLPRI - EPOLLOUT = 0x004, -#define EPOLLOUT EPOLLOUT - EPOLLRDNORM = 0x040, -#define EPOLLRDNORM EPOLLRDNORM - EPOLLRDBAND = 0x080, -#define EPOLLRDBAND EPOLLRDBAND - EPOLLWRNORM = 0x100, -#define EPOLLWRNORM EPOLLWRNORM - EPOLLWRBAND = 0x200, -#define EPOLLWRBAND EPOLLWRBAND - EPOLLMSG = 0x400, -#define EPOLLMSG EPOLLMSG - EPOLLERR = 0x008, -#define EPOLLERR EPOLLERR - EPOLLHUP = 0x010, -#define EPOLLHUP EPOLLHUP - EPOLLRDHUP = 0x2000, -#define EPOLLRDHUP EPOLLRDHUP - EPOLLONESHOT = 1u << 30, -#define EPOLLONESHOT EPOLLONESHOT - EPOLLET = 1u << 31 -#define EPOLLET EPOLLET - }; - - -/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ -#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ -#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ -#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ - - -typedef union epoll_data -{ - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -struct epoll_event -{ - uint32_t events; /* Epoll events */ - epoll_data_t data; /* User data variable */ -}; - - -__BEGIN_DECLS - -/* Creates an epoll instance. Returns an fd for the new instance. - The "size" parameter is a hint specifying the number of file - descriptors to be associated with the new instance. The fd - returned by epoll_create() should be closed with close(). */ -extern int epoll_create (int __size) __THROW; - -/* Same as epoll_create but with an FLAGS parameter. The unused SIZE - parameter has been dropped. */ -extern int epoll_create1 (int __flags) __THROW; - - -/* Manipulate an epoll instance "epfd". Returns 0 in case of success, - -1 in case of error ( the "errno" variable will contain the - specific error code ) The "op" parameter is one of the EPOLL_CTL_* - constants defined above. The "fd" parameter is the target of the - operation. The "event" parameter describes which events the caller - is interested in and any associated user data. */ -extern int epoll_ctl (int __epfd, int __op, int __fd, - struct epoll_event *__event) __THROW; - - -/* Wait for events on an epoll instance "epfd". Returns the number of - triggered events returned in "events" buffer. Or -1 in case of - error with the "errno" variable set to the specific error code. The - "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). - - 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); - - -/* Same as epoll_wait, but the thread's signal mask is temporarily - and atomically replaced with the one provided as parameter. - - This function is a cancellation point and therefore not marked with - __THROW. */ -extern int epoll_pwait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout, - const __sigset_t *__ss); - -__END_DECLS - -#endif /* sys/epoll.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/timerfd.h b/ports/sysdeps/unix/sysv/linux/mips/sys/timerfd.h deleted file mode 100644 index 1238698d2..000000000 --- a/ports/sysdeps/unix/sysv/linux/mips/sys/timerfd.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2008, 2012 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along 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_TIMERFD_H -#define _SYS_TIMERFD_H 1 - -#include <time.h> - - -/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ -enum - { - TFD_CLOEXEC = 02000000, -#define TFD_CLOEXEC TFD_CLOEXEC - TFD_NONBLOCK = 0200 -#define TFD_NONBLOCK TFD_NONBLOCK - }; - - -/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */ -enum - { - TFD_TIMER_ABSTIME = 1 << 0 -#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME - }; - - -__BEGIN_DECLS - -/* Return file descriptor for new interval timer source. */ -extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW; - -/* Set next expiration time of interval timer source UFD to UTMR. If - FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is - absolute. Optionally return the old expiration time in OTMR. */ -extern int timerfd_settime (int __ufd, int __flags, - const struct itimerspec *__utmr, - struct itimerspec *__otmr) __THROW; - -/* Return the next expiration time of UFD. */ -extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; - -__END_DECLS - -#endif /* sys/timerfd.h */ |