diff options
236 files changed, 85 insertions, 18273 deletions
@@ -8,7 +8,17 @@ * sysdeps/unix/sysv/linux/alpha/fxstatat.c: Fix hidden defs. -2006-02-20 Roland McGrath <roland@frob.com> +2006-02-20 Roland McGrath <roland@redhat.com> + + * sysdeps/mips: Directory removed, saved in ports repository. + * sysdeps/unix/mips: Likewise. + * sysdeps/unix/sysv/linux/mips: Likewise. + * sysdeps/mach/mips: Likewise. + * sysdeps/mach/hurd/mips: Likewise. + * shlib-versions: Remove mips matches, now in ports fragment. + * sysdeps/unix/sysv/linux/kernel-features.h: Likewise. + * configure.in (machine): Likewise. + * configure: Regenerated. * hurd/hurd/xattr.h: New file. * hurd/xattr.c: New file. @@ -24,6 +34,23 @@ * sysdeps/mach/hurd/removexattr.c: New file. * sysdeps/mach/hurd/setxattr.c: New file. +2006-02-15 Thomas Schwinge <tschwinge@gnu.org> + + [BZ #2329] + * include/unistd.h (__getresuid, __getresgid, __setresuid) + (__setresgid): Fix argument name order in prototypes. + * posix/unistd.h (getresuid, getresgid, setresuid, setresgid): + Likewise. + * posix/getresuid.c (__getresuid): Fix argument order in definition. + * posix/getresgid.c (__getresgid): Likewise. + * posix/setresuid.c (__setresuid): Likewise. + * posix/setresgid.c (__setresgid): Likewise. + * sysdeps/mach/hurd/getresuid.c (__getresuid): Likewise. + * sysdeps/mach/hurd/getresgid.c (__getresgid): Likewise. + * sysdeps/mach/hurd/setresuid.c (__setresuid): Likewise. + * sysdeps/mach/hurd/setresgid.c (__setresgid): Likewise. + Reported by Samuel Thibault <samuel.thibault@ens-lyon.org>. + 2006-02-13 Mike Frysinger <vapier@gentoo.org> * string/tester.c (test_strnlen): New function. diff --git a/configure.in b/configure.in index dfbf3f1420..78715156dd 100644 --- a/configure.in +++ b/configure.in @@ -448,33 +448,6 @@ m680?0) base_machine=m68k machine=m68k/$machine ;; m68k) base_machine=m68k machine=m68k/m68020 ;; m88???) base_machine=m88k machine=m88k/$machine ;; m88k) base_machine=m88k machine=m88k/m88100 ;; -mips64*) base_machine=mips64 - case "$CC $CFLAGS $CPPFLAGS " in - *" -mabi=n32 "*) mips_cc_abi=n32 ;; - *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;; - *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;; - *) mips_cc_abi=default ;; - esac - case $config_os in - *abin32*) mips_config_abi=n32 ;; - *abi64*|*abin64*) mips_config_abi=64 ;; - *abi32*|*abio32*) mips_config_abi=32 ;; - *) mips_config_abi=$mips_cc_abi ;; - esac - case $mips_config_abi in - default) machine=mips/mips64/n32 mips_config_abi=n32 ;; - n32) machine=mips/mips64/n32 ;; - 64) machine=mips/mips64/n64 ;; - 32) machine=mips/mips32/kern64 ;; - esac - machine=$machine/$config_machine - if test $mips_config_abi != $mips_cc_abi; then - # This won't make it to config.make, but we want to - # set this in case configure tests depend on it. - CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi" - fi - ;; -mips*) base_machine=mips machine=mips/mips32/$machine ;; powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; s390) base_machine=s390 machine=s390/s390-32 ;; diff --git a/include/unistd.h b/include/unistd.h index f4d6cad7b6..670cb324ae 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -96,10 +96,10 @@ extern int __setgid (__gid_t __gid); extern int __setpgid (__pid_t __pid, __pid_t __pgid); libc_hidden_proto (__setpgid) extern int __setregid (__gid_t __rgid, __gid_t __egid); -extern int __getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); -extern int __getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); -extern int __setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); -extern int __setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); +extern int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid); +extern int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid); +extern int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid); +extern int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid); libc_hidden_proto (__getresuid) libc_hidden_proto (__getresgid) libc_hidden_proto (__setresuid) diff --git a/nptl/sysdeps/mips/Makefile b/nptl/sysdeps/mips/Makefile deleted file mode 100644 index d0c59a5091..0000000000 --- a/nptl/sysdeps/mips/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2005 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -# 02111-1307 USA. - -ifeq ($(subdir),csu) -gen-as-const-headers += tcb-offsets.sym -endif - -ifeq ($(subdir),nptl) -libpthread-sysdep_routines += nptl-sysdep -endif diff --git a/nptl/sysdeps/mips/nptl-sysdep.S b/nptl/sysdeps/mips/nptl-sysdep.S deleted file mode 100644 index 3f5c2a364a..0000000000 --- a/nptl/sysdeps/mips/nptl-sysdep.S +++ /dev/null @@ -1,2 +0,0 @@ -/* Pull in __syscall_error. */ -#include <sysdep.S> diff --git a/nptl/sysdeps/mips/pthread_spin_lock.S b/nptl/sysdeps/mips/pthread_spin_lock.S deleted file mode 100644 index d5f2a72340..0000000000 --- a/nptl/sysdeps/mips/pthread_spin_lock.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/asm.h> -#include <sysdep.h> -#include <sgidefs.h> - -ENTRY (pthread_spin_lock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 -#endif -1: ll a2, 0(a0) - li a1, 1 - bnez a2, 1b - sc a1, 0(a0) - beqz a1, 1b - MIPS_SYNC - .set pop - li v0, 0 - ret -PSEUDO_END (pthread_spin_lock) diff --git a/nptl/sysdeps/mips/pthread_spin_trylock.S b/nptl/sysdeps/mips/pthread_spin_trylock.S deleted file mode 100644 index 9c6e740f0f..0000000000 --- a/nptl/sysdeps/mips/pthread_spin_trylock.S +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/asm.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#include <sgidefs.h> - -ENTRY (pthread_spin_trylock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 -#endif - ll a2, 0(a0) - li a1, 1 - bnez a2, 1f - sc a1, 0(a0) - beqz a1, 1f - MIPS_SYNC - .set pop - li v0, 0 - ret -1: li v0, EBUSY - ret -PSEUDO_END (pthread_spin_trylock) diff --git a/nptl/sysdeps/mips/pthreaddef.h b/nptl/sysdeps/mips/pthreaddef.h deleted file mode 100644 index e72b4bc58d..0000000000 --- a/nptl/sysdeps/mips/pthreaddef.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Default stack size. */ -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) - -/* Required stack pointer alignment at beginning. */ -#define STACK_ALIGN 16 - -/* Minimal stack size after allocating thread descriptor and guard size. */ -#define MINIMAL_REST_STACK 2048 - -/* Alignment requirement for TCB. */ -#define TCB_ALIGNMENT 16 - - -/* Location of current stack frame. */ -#define CURRENT_STACK_FRAME __builtin_frame_address (0) - - -/* XXX Until we have a better place keep the definitions here. */ - -#define __exit_thread_inline(val) \ - INLINE_SYSCALL (exit, 1, (val)) diff --git a/nptl/sysdeps/mips/tcb-offsets.sym b/nptl/sysdeps/mips/tcb-offsets.sym deleted file mode 100644 index e0e71dc430..0000000000 --- a/nptl/sysdeps/mips/tcb-offsets.sym +++ /dev/null @@ -1,11 +0,0 @@ -#include <sysdep.h> -#include <tls.h> - --- - --- Abuse tls.h macros to derive offsets relative to the thread register. -#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) - -MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) -TID_OFFSET thread_offsetof (tid) diff --git a/nptl/sysdeps/mips/tls.h b/nptl/sysdeps/mips/tls.h deleted file mode 100644 index 1cef161010..0000000000 --- a/nptl/sysdeps/mips/tls.h +++ /dev/null @@ -1,161 +0,0 @@ -/* Definition for thread-local data handling. NPTL/MIPS version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _TLS_H -#define _TLS_H 1 - -#include <dl-sysdep.h> - -#ifndef __ASSEMBLER__ -# include <stdbool.h> -# include <stddef.h> -# include <stdint.h> - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - -/* Note: rd must be $v1 to be ABI-conformant. */ -# define READ_THREAD_POINTER() \ - ({ void *__result; \ - asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \ - "rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \ - __result; }) - -#else /* __ASSEMBLER__ */ -# include <tcb-offsets.h> - -# define READ_THREAD_POINTER(rd) \ - .set push; \ - .set mips32r2; \ - rdhwr rd, $29; \ - .set pop -#endif /* __ASSEMBLER__ */ - - -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - -/* Signal that TLS support is available. */ -#define USE_TLS 1 - -#ifndef __ASSEMBLER__ - -/* Get system call information. */ -# include <sysdep.h> - -/* The TP points to the start of the thread blocks. */ -# define TLS_DTV_AT_TP 1 - -/* Get the thread descriptor definition. */ -# include <nptl/descr.h> - -typedef struct -{ - dtv_t *dtv; - void *private; -} tcbhead_t; - -/* This is the size of the initial TCB. Because our TCB is before the thread - pointer, we don't need this. */ -# define TLS_INIT_TCB_SIZE 0 - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread) - -/* This is the size of the TCB. Because our TCB is before the thread - pointer, we don't need this. */ -# define TLS_TCB_SIZE 0 - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (struct pthread) - -/* This is the size we need before TCB - actually, it includes the TCB. */ -# define TLS_PRE_TCB_SIZE \ - (sizeof (struct pthread) \ - + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) - -/* The thread pointer (in hardware register $29) points to the end of - the TCB + 0x7000, as for PowerPC. The pthread_descr structure is - immediately in front of the TCB. */ -# define TLS_TCB_OFFSET 0x7000 - -/* Install the dtv pointer. The pointer passed is to the element with - index -1 which contain the length. */ -# define INSTALL_DTV(tcbp, dtvp) \ - (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1) - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(dtv) \ - (THREAD_DTV() = (dtv)) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(tcbp) \ - (((tcbhead_t *) (tcbp))[-1].dtv) - -/* Code to initially initialize the thread pointer. This might need - special attention since 'errno' is not yet available and if the - operation can cause a failure 'errno' must not be touched. */ -# define TLS_INIT_TP(tcbp, secondcall) \ - ({ INTERNAL_SYSCALL_DECL (err); \ - long result_var; \ - result_var = INTERNAL_SYSCALL (set_thread_area, err, 1, \ - (char *) (tcbp) + TLS_TCB_OFFSET); \ - INTERNAL_SYSCALL_ERROR_P (result_var, err) \ - ? "unknown error" : NULL; }) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - (((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv) - -/* Return the thread descriptor for the current thread. */ -# define THREAD_SELF \ - ((struct pthread *) (READ_THREAD_POINTER () \ - - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)) - -/* Magic for libthread_db to know how to do THREAD_SELF. */ -# define DB_THREAD_SELF \ - CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) - -/* Access to data in the thread descriptor is easy. */ -# define THREAD_GETMEM(descr, member) \ - descr->member -# define THREAD_GETMEM_NC(descr, member, idx) \ - descr->member[idx] -# define THREAD_SETMEM(descr, member, value) \ - descr->member = (value) -# define THREAD_SETMEM_NC(descr, member, idx, value) \ - descr->member[idx] = (value) - -/* l_tls_offset == 0 is perfectly valid on MIPS, so we have to use some - different value to mean unset l_tls_offset. */ -# define NO_TLS_OFFSET -1 - -#endif /* __ASSEMBLER__ */ - -#endif /* tls.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h deleted file mode 100644 index d5e89a9364..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h +++ /dev/null @@ -1,202 +0,0 @@ -/* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#if _MIPS_SIM == _ABI64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#else -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 20 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#endif - - -/* Thread identifiers. The structure of the attribute type is - deliberately not exposed. */ -typedef unsigned long int pthread_t; - - -typedef union -{ - char __size[__SIZEOF_PTHREAD_ATTR_T]; - long int __align; -} pthread_attr_t; - - -/* Data structures for mutex handling. The structure of the attribute - type is deliberately not exposed. */ -typedef union -{ - struct __pthread_mutex_s - { - int __lock; - unsigned int __count; - int __owner; -#if _MIPS_SIM == _ABI64 - unsigned int __nusers; -#endif - /* KIND must stay at this position in the structure to maintain - binary compatibility. */ - int __kind; -#if _MIPS_SIM == _ABI64 - int __spins; - struct __pthread_mutex_s *__next; - struct __pthread_mutex_s *__prev; -# define __PTHREAD_MUTEX_HAVE_PREV 1 -#else - unsigned int __nusers; - __extension__ union - { - int __spins; - struct __pthread_mutex_s *__next; - }; -#endif - } __data; - char __size[__SIZEOF_PTHREAD_MUTEX_T]; - long int __align; -} pthread_mutex_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; - int __align; -} pthread_mutexattr_t; - - -/* Data structure for conditional variable handling. The structure of - the attribute type is deliberately not exposed. */ -typedef union -{ - struct - { - int __lock; - unsigned int __futex; - __extension__ unsigned long long int __total_seq; - __extension__ unsigned long long int __wakeup_seq; - __extension__ unsigned long long int __woken_seq; - void *__mutex; - unsigned int __nwaiters; - unsigned int __broadcast_seq; - } __data; - char __size[__SIZEOF_PTHREAD_COND_T]; - __extension__ long long int __align; -} pthread_cond_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_CONDATTR_T]; - int __align; -} pthread_condattr_t; - - -/* Keys for thread-specific data */ -typedef unsigned int pthread_key_t; - - -/* Once-only execution */ -typedef int pthread_once_t; - - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -/* Data structure for read-write lock variable handling. The - structure of the attribute type is deliberately not exposed. */ -typedef union -{ -# if _MIPS_SIM == _ABI64 - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - int __writer; - int __pad1; - unsigned long int __pad2; - unsigned long int __pad3; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned int __flags; - } __data; -# else - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned int __flags; - int __writer; - } __data; -# endif - char __size[__SIZEOF_PTHREAD_RWLOCK_T]; - long int __align; -} pthread_rwlock_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; - long int __align; -} pthread_rwlockattr_t; -#endif - - -#ifdef __USE_XOPEN2K -/* POSIX spinlock data type. */ -typedef volatile int pthread_spinlock_t; - - -/* POSIX barriers data type. The structure of the type is - deliberately not exposed. */ -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIER_T]; - long int __align; -} pthread_barrier_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; - int __align; -} pthread_barrierattr_t; -#endif - - -#endif /* bits/pthreadtypes.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h b/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h deleted file mode 100644 index c4440f9e9e..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SEMAPHORE_H -# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." -#endif - -#if _MIPS_SIM == _ABI64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif - -/* Value returned if `sem_open' failed. */ -#define SEM_FAILED ((sem_t *) 0) - -/* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) - - -typedef union -{ - char __size[__SIZEOF_SEM_T]; - long int __align; -} sem_t; diff --git a/nptl/sysdeps/unix/sysv/linux/mips/clone.S b/nptl/sysdeps/unix/sysv/linux/mips/clone.S deleted file mode 100644 index 80c265bf6c..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/clone.S +++ /dev/null @@ -1,2 +0,0 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/mips/clone.S> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/createthread.c b/nptl/sysdeps/unix/sysv/linux/mips/createthread.c deleted file mode 100644 index 5b2234f470..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/createthread.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Value passed to 'clone' for initialization of the thread register. */ -#define TLS_VALUE ((void *) (pd) \ - + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) - -/* Get the real implementation. */ -#include <nptl/sysdeps/pthread/createthread.c> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/fork.c b/nptl/sysdeps/unix/sysv/linux/mips/fork.c deleted file mode 100644 index 06b7e1c69f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/fork.c +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/fork.c" diff --git a/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h deleted file mode 100644 index 7edb28794f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LOWLEVELLOCK_H -#define _LOWLEVELLOCK_H 1 - -#include <time.h> -#include <sys/param.h> -#include <bits/pthreadtypes.h> -#include <atomic.h> -#include <sysdep.h> - - -#define FUTEX_WAIT 0 -#define FUTEX_WAKE 1 -#define FUTEX_REQUEUE 3 -#define FUTEX_CMP_REQUEUE 4 - -/* Initializer for compatibility lock. */ -#define LLL_MUTEX_LOCK_INITIALIZER (0) - -#define lll_futex_wait(futexp, val) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAIT, (val), 0); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -#define lll_futex_timed_wait(futexp, val, timespec) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAIT, (val), (timespec)); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -#define lll_futex_wake(futexp, nr) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 4, \ - (futexp), FUTEX_WAKE, (nr), 0); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ - }) - -/* Returns non-zero if error happened, zero if success. */ -#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ - __ret = INTERNAL_SYSCALL (futex, __err, 6, \ - (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \ - (nr_move), (mutex), (val)); \ - INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ - }) - - -static inline int __attribute__((always_inline)) -__lll_mutex_trylock(int *futex) -{ - return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; -} -#define lll_mutex_trylock(lock) __lll_mutex_trylock (&(lock)) - - -static inline int __attribute__((always_inline)) -__lll_mutex_cond_trylock(int *futex) -{ - return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; -} -#define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock)) - - -extern void __lll_lock_wait (int *futex) attribute_hidden; - -static inline void __attribute__((always_inline)) -__lll_mutex_lock(int *futex) -{ - if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) - __lll_lock_wait (futex); -} -#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex)) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_cond_lock (int *futex) -{ - if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0) - __lll_lock_wait (futex); -} -#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex)) - - -extern int __lll_timedlock_wait (int *futex, const struct timespec *) - attribute_hidden; - -static inline int __attribute__ ((always_inline)) -__lll_mutex_timedlock (int *futex, const struct timespec *abstime) -{ - int result = 0; - if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) - result = __lll_timedlock_wait (futex, abstime); - return result; -} -#define lll_mutex_timedlock(futex, abstime) \ - __lll_mutex_timedlock (&(futex), abstime) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_unlock (int *futex) -{ - int val = atomic_exchange_rel (futex, 0); - if (__builtin_expect (val > 1, 0)) - lll_futex_wake (futex, 1); -} -#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex)) - - -static inline void __attribute__ ((always_inline)) -__lll_mutex_unlock_force (int *futex) -{ - (void) atomic_exchange_rel (futex, 0); - lll_futex_wake (futex, 1); -} -#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex)) - - -#define lll_mutex_islocked(futex) \ - (futex != 0) - - -/* Our internal lock implementation is identical to the binary-compatible - mutex implementation. */ - -/* Type for lock object. */ -typedef int lll_lock_t; - -/* Initializers for lock. */ -#define LLL_LOCK_INITIALIZER (0) -#define LLL_LOCK_INITIALIZER_LOCKED (1) - -extern int lll_unlock_wake_cb (int *__futex) attribute_hidden; - -/* The states of a lock are: - 0 - untaken - 1 - taken by one user - >1 - taken by more users */ - -#define lll_trylock(lock) lll_mutex_trylock (lock) -#define lll_lock(lock) lll_mutex_lock (lock) -#define lll_unlock(lock) lll_mutex_unlock (lock) -#define lll_islocked(lock) lll_mutex_islocked (lock) - -/* The kernel notifies a process which uses CLONE_CLEARTID via futex - wakeup when the clone terminates. The memory location contains the - thread ID while the clone is running and is reset to zero - afterwards. */ -#define lll_wait_tid(tid) \ - do { \ - __typeof (tid) __tid; \ - while ((__tid = (tid)) != 0) \ - lll_futex_wait (&(tid), __tid); \ - } while (0) - -extern int __lll_timedwait_tid (int *, const struct timespec *) - attribute_hidden; - -#define lll_timedwait_tid(tid, abstime) \ - ({ \ - int __res = 0; \ - if ((tid) != 0) \ - __res = __lll_timedwait_tid (&(tid), (abstime)); \ - __res; \ - }) - - -/* Conditional variable handling. */ - -extern void __lll_cond_wait (pthread_cond_t *cond) - attribute_hidden; -extern int __lll_cond_timedwait (pthread_cond_t *cond, - const struct timespec *abstime) - attribute_hidden; -extern void __lll_cond_wake (pthread_cond_t *cond) - attribute_hidden; -extern void __lll_cond_broadcast (pthread_cond_t *cond) - attribute_hidden; - -#define lll_cond_wait(cond) \ - __lll_cond_wait (cond) -#define lll_cond_timedwait(cond, abstime) \ - __lll_cond_timedwait (cond, abstime) -#define lll_cond_wake(cond) \ - __lll_cond_wake (cond) -#define lll_cond_broadcast(cond) \ - __lll_cond_broadcast (cond) - -#endif /* lowlevellock.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S b/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S deleted file mode 100644 index fe2b81bc1f..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <tls.h> - -/* Save the PID value. */ -#define SAVE_PID \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Negate it. */ \ - sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ - -/* Restore the old PID value in the parent. */ -#define RESTORE_PID \ - beqz v0, 1f; /* If we are the parent... */ \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Re-negate it. */ \ - sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ -1: - -#include <../sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c b/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c deleted file mode 100644 index 649b752f54..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include "pthreadP.h" -#include <lowlevellock.h> - - -unsigned long int __fork_generation attribute_hidden; - - -static void -clear_once_control (void *arg) -{ - pthread_once_t *once_control = (pthread_once_t *) arg; - - *once_control = 0; - lll_futex_wake (once_control, INT_MAX); -} - - -int -__pthread_once (once_control, init_routine) - pthread_once_t *once_control; - void (*init_routine) (void); -{ - while (1) - { - int oldval, val, newval; - - val = *once_control; - do - { - /* Check if the initialized has already been done. */ - if ((val & 2) != 0) - return 0; - - oldval = val; - newval = (oldval & 3) | __fork_generation | 1; - val = atomic_compare_and_exchange_val_acq (once_control, newval, - oldval); - } - while (__builtin_expect (val != oldval, 0)); - - /* Check if another thread already runs the initializer. */ - if ((oldval & 1) != 0) - { - /* Check whether the initializer execution was interrupted - by a fork. */ - if (((oldval ^ newval) & -4) == 0) - { - /* Same generation, some other thread was faster. Wait. */ - lll_futex_wait (once_control, newval); - continue; - } - } - - /* This thread is the first here. Do the initialization. - Register a cleanup handler so that in case the thread gets - interrupted the initialization can be restarted. */ - pthread_cleanup_push (clear_once_control, once_control); - - init_routine (); - - pthread_cleanup_pop (0); - - - /* Add one to *once_control. */ - atomic_increment (once_control); - - /* Wake up all other threads. */ - lll_futex_wake (once_control, INT_MAX); - break; - } - - return 0; -} -weak_alias (__pthread_once, pthread_once) -strong_alias (__pthread_once, __pthread_once_internal) diff --git a/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h deleted file mode 100644 index 02508e2155..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h +++ /dev/null @@ -1,170 +0,0 @@ -/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <sysdeps/generic/sysdep.h> -#include <tls.h> -#ifndef __ASSEMBLER__ -# include <nptl/pthreadP.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -#ifdef __PIC__ -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .align 2; \ - L(pseudo_start): \ - cfi_startproc; \ - 99: la t9,__syscall_error; \ - jr t9; \ - .type __##syscall_name##_nocancel, @function; \ - .globl __##syscall_name##_nocancel; \ - __##syscall_name##_nocancel: \ - .set noreorder; \ - .cpload t9; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - ret; \ - .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ - ENTRY (name) \ - .set noreorder; \ - .cpload t9; \ - .set reorder; \ - SINGLE_THREAD_P(v1); \ - bne zero, v1, L(pseudo_cancel); \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - ret; \ - L(pseudo_cancel): \ - SAVESTK_##args; \ - sw ra, 28(sp); \ - cfi_rel_offset (ra, 28); \ - sw gp, 32(sp); \ - cfi_rel_offset (gp, 32); \ - PUSHARGS_##args; /* save syscall args */ \ - CENABLE; \ - lw gp, 32(sp); \ - sw v0, 44(sp); /* save mask */ \ - POPARGS_##args; /* restore syscall args */ \ - .set noreorder; \ - li v0, SYS_ify (syscall_name); \ - syscall; \ - .set reorder; \ - sw v0, 36(sp); /* save syscall result */ \ - sw a3, 40(sp); /* save syscall error flag */ \ - lw a0, 44(sp); /* pass mask as arg1 */ \ - CDISABLE; \ - lw gp, 32(sp); \ - lw v0, 36(sp); /* restore syscall result */ \ - lw a3, 40(sp); /* restore syscall error flag */ \ - lw ra, 28(sp); /* restore return address */ \ - .set noreorder; \ - bne a3, zero, SYSCALL_ERROR_LABEL; \ - RESTORESTK; \ - L(pseudo_end): \ - .set reorder; - -# undef PSEUDO_END -# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym - -#endif - -# define PUSHARGS_0 /* nothing to do */ -# define PUSHARGS_1 PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0); -# define PUSHARGS_2 PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4); -# define PUSHARGS_3 PUSHARGS_2 sw a2, 8(sp); cfi_rel_offset (a2, 8); -# define PUSHARGS_4 PUSHARGS_3 sw a3, 12(sp); cfi_rel_offset (a3, 12); -# define PUSHARGS_5 PUSHARGS_4 /* handled by SAVESTK_## */ -# define PUSHARGS_6 PUSHARGS_5 -# define PUSHARGS_7 PUSHARGS_6 - -# define POPARGS_0 /* nothing to do */ -# define POPARGS_1 POPARGS_0 lw a0, 0(sp); -# define POPARGS_2 POPARGS_1 lw a1, 4(sp); -# define POPARGS_3 POPARGS_2 lw a2, 8(sp); -# define POPARGS_4 POPARGS_3 lw a3, 12(sp); -# define POPARGS_5 POPARGS_4 /* args already in new stackframe */ -# define POPARGS_6 POPARGS_5 -# define POPARGS_7 POPARGS_6 - - -# define STKSPACE 48 -# define SAVESTK_0 subu sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE) -# define SAVESTK_1 SAVESTK_0 -# define SAVESTK_2 SAVESTK_1 -# define SAVESTK_3 SAVESTK_2 -# define SAVESTK_4 SAVESTK_3 -# define SAVESTK_5 lw t0, 16(sp); \ - SAVESTK_0; \ - sw t0, 16(sp) - -# define SAVESTK_6 lw t0, 16(sp); \ - lw t1, 20(sp); \ - SAVESTK_0; \ - sw t0, 16(sp); \ - sw t1, 20(sp) - -# define SAVESTK_7 lw t0, 16(sp); \ - lw t1, 20(sp); \ - lw t2, 24(sp); \ - SAVESTK_0; \ - sw t0, 16(sp); \ - sw t1, 20(sp); \ - sw t2, 24(sp) - -# define RESTORESTK addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE) - - -/* We use jalr rather than jal. This means that the assembler will not - automatically restore $gp (in case libc has multiple GOTs) so we must - do it manually - which we have to do anyway since we don't use .cprestore. - It also shuts up the assembler warning about not using .cprestore. */ -# ifdef IS_IN_libpthread -# define CENABLE la t9, __pthread_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9; -# elif defined IS_IN_librt -# define CENABLE la t9, __librt_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __librt_disable_asynccancel; jalr t9; -# else -# define CENABLE la t9, __libc_enable_asynccancel; jalr t9; -# define CDISABLE la t9, __libc_disable_asynccancel; jalr t9; -# endif - -# ifndef __ASSEMBLER__ -# define SINGLE_THREAD_P \ - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) \ - == 0, 1) -# else -# define SINGLE_THREAD_P(reg) \ - READ_THREAD_POINTER(reg); \ - lw reg, MULTIPLE_THREADS_OFFSET(reg) -#endif - -#elif !defined __ASSEMBLER__ - -# define SINGLE_THREAD_P 1 -# define NO_CANCELLATION 1 - -#endif diff --git a/nptl/sysdeps/unix/sysv/linux/mips/vfork.S b/nptl/sysdeps/unix/sysv/linux/mips/vfork.S deleted file mode 100644 index 874a2e2bf4..0000000000 --- a/nptl/sysdeps/unix/sysv/linux/mips/vfork.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <tls.h> - -/* Save the PID value. */ -#define SAVE_PID \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Negate it. */ \ - bnez a2, 1f; /* If it was zero... */ \ - lui a2, 0x8000; /* use 0x80000000 instead. */ \ -1: sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ - -/* Restore the old PID value in the parent. */ -#define RESTORE_PID \ - beqz v0, 1f; /* If we are the parent... */ \ - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ - subu a2, $0, a2; /* Re-negate it. */ \ - lui a0, 0x8000; /* Load 0x80000000... */ \ - bne a2, a0, 2f; /* ... compare against it... */ \ - li a2, 0; /* ... use 0 instead. */ \ -2: sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ -1: - -#include <../sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/posix/getresgid.c b/posix/getresgid.c index d6a9b52957..eccce7d69c 100644 --- a/posix/getresgid.c +++ b/posix/getresgid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,1998,2002,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ int -__getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) +__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) { __set_errno (ENOSYS); return -1; diff --git a/posix/getresuid.c b/posix/getresuid.c index 227d6b7ded..83456c29b8 100644 --- a/posix/getresuid.c +++ b/posix/getresuid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,1998,2002,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ int -__getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) +__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { __set_errno (ENOSYS); return -1; diff --git a/posix/setresgid.c b/posix/setresgid.c index 78e308c5d0..736c22e4c1 100644 --- a/posix/setresgid.c +++ b/posix/setresgid.c @@ -1,5 +1,5 @@ -/* setresgid -- set effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* setresgid -- set real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ int -__setresgid (gid_t egid, gid_t rgid, gid_t sgid) +__setresgid (gid_t rgid, gid_t egid, gid_t sgid) { __set_errno (ENOSYS); return -1; diff --git a/posix/setresuid.c b/posix/setresuid.c index 430b63b2fd..89263330e3 100644 --- a/posix/setresuid.c +++ b/posix/setresuid.c @@ -1,5 +1,5 @@ -/* setresuid -- set effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* setresuid -- set real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,10 +20,10 @@ #include <errno.h> #include <unistd.h> -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ int -__setresuid (uid_t euid, uid_t ruid, uid_t suid) +__setresuid (uid_t ruid, uid_t euid, uid_t suid) { __set_errno (ENOSYS); return -1; diff --git a/posix/unistd.h b/posix/unistd.h index acb8f6f11d..bcd184ba20 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -693,24 +693,24 @@ extern int setegid (__gid_t __gid) __THROW; #endif /* Use BSD. */ #ifdef __USE_GNU -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ -extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid) +extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) __THROW; -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ -extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid) +extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) __THROW; -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ -extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid) +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ +extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW; -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ -extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid) +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ +extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW; #endif diff --git a/shlib-versions b/shlib-versions index e8c80826d5..ef12615131 100644 --- a/shlib-versions +++ b/shlib-versions @@ -49,7 +49,6 @@ sparc.*-.*-.* WORDSIZE64 sparc64-@VENDOR@-@OS@ # The interface to -lm depends mostly only on cpu, not on operating system. sparc64-.*-linux.* libm=6 GLIBC_2.2 alpha.*-.*-linux.* libm=6.1 -mips.*-.*-linux.* libm=6 GLIBC_2.0 GLIBC_2.2 ia64-.*-linux.* libm=6.1 GLIBC_2.2 sh.*-.*-linux.* libm=6 GLIBC_2.2 hppa.*-.*-.* libm=6 GLIBC_2.2 @@ -58,8 +57,6 @@ hppa.*-.*-.* libm=6 GLIBC_2.2 # We provide libc.so.6 for Linux kernel versions 2.0 and later. alpha.*-.*-linux.* libc=6.1 -# Working mips versions were never released between 2.0 and 2.2. -mips.*-.*-linux.* libc=6 GLIBC_2.0 GLIBC_2.2 ia64-.*-linux.* libc=6.1 GLIBC_2.2 sh.*-.*-linux.* libc=6 GLIBC_2.2 sparc64-.*-linux.* libc=6 GLIBC_2.2 @@ -82,7 +79,6 @@ sparc.*-.*-linux.* ld=ld-linux.so.2 alpha.*-.*-linux.* ld=ld-linux.so.2 sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 ia64-.*-linux.* ld=ld-linux-ia64.so.2 GLIBC_2.2 -mips.*-.*-linux.* ld=ld.so.1 GLIBC_2.0 GLIBC_2.2 hppa.*-.*-.* ld=ld.so.1 GLIBC_2.2 s390x-.*-linux.* ld=ld64.so.1 GLIBC_2.2 powerpc64.*-.*-linux.* ld=ld64.so.1 GLIBC_2.3 @@ -93,7 +89,6 @@ x86_64-.*-linux.* ld=ld-linux-x86-64.so.2 GLIBC_2.2.5 # The -ldl interface (see <dlfcn.h>) is the same on all platforms. alpha.*-.*-linux.* libdl=2.1 -mips.*-.*-linux.* libdl=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libdl=2 # So far the -lutil interface is the same on all platforms, except for the @@ -104,19 +99,11 @@ alpha.*-.*-linux.* libutil=1.1 # Version number 2 is used on other systems for the BIND 4.9.5 resolver # interface. alpha.*-.*-linux.* libresolv=2.1 -mips.*-.*-linux.* libresolv=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libresolv=2 # Interface revision of nss_* modules. This must match NSS_SHLIB_REVISION # in nss/nsswitch.h, which determines the library names used for service # names given in /etc/nsswitch.conf. -mips.*-.*-linux.* libnss_files=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_dns=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_compat=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nis=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nisplus=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_ldap=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libnss_files=2 .*-.*-.* libnss_dns=2 .*-.*-.* libnss_compat=2 @@ -127,7 +114,6 @@ mips.*-.*-linux.* libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 # Version for libnsl with YP and NIS+ functions. alpha.*-.*-linux.* libnsl=1.1 -mips.*-.*-linux.* libnsl=1 GLIBC_2.0 GLIBC_2.2 .*-.*-.* libnsl=1 # This defines the shared library version numbers we will install. @@ -143,7 +129,6 @@ hppa-.*-.* libBrokenLocale=1 GLIBC_2.2 .*-.*-.* libBrokenLocale=1 # The real-time library from POSIX.1b. -mips.*-.*-linux.* librt=1 GLIBC_2.0 GLIBC_2.2 .*-.*-.* librt=1 # The asynchronous name lookup library. diff --git a/sysdeps/mach/hurd/getresgid.c b/sysdeps/mach/hurd/getresgid.c index a96aa49369..7847d213c4 100644 --- a/sysdeps/mach/hurd/getresgid.c +++ b/sysdeps/mach/hurd/getresgid.c @@ -1,5 +1,5 @@ -/* getresgid -- fetch effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* getresgid -- fetch real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,13 +22,13 @@ #include <hurd.h> #include <hurd/id.h> -/* Fetch the effective group ID, real group ID, and saved-set group ID, +/* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ int -__getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) +__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) { error_t err; - gid_t eff, real, saved; + gid_t real, eff, saved; HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_id.lock); @@ -42,8 +42,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) else { real = _hurd_id.aux.gids[0]; - saved = _hurd_id.aux.ngids < 2 ? real :_hurd_id.aux.gids[1]; eff = _hurd_id.gen.ngids < 1 ? real : _hurd_id.gen.gids[0]; + saved = _hurd_id.aux.ngids < 2 ? real : _hurd_id.aux.gids[1]; } } @@ -53,8 +53,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid) if (err) return __hurd_fail (err); - *egid = eff; *rgid = real; + *egid = eff; *sgid = saved; return 0; } diff --git a/sysdeps/mach/hurd/getresuid.c b/sysdeps/mach/hurd/getresuid.c index f4bfaeaf56..668e463a39 100644 --- a/sysdeps/mach/hurd/getresuid.c +++ b/sysdeps/mach/hurd/getresuid.c @@ -1,5 +1,5 @@ -/* getresuid -- fetch effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002 Free Software Foundation, Inc. +/* getresuid -- fetch real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,13 +22,13 @@ #include <hurd.h> #include <hurd/id.h> -/* Fetch the effective user ID, real user ID, and saved-set user ID, +/* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ int -__getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) +__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { error_t err; - uid_t eff, real, saved; + uid_t real, eff, saved; HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_id.lock); @@ -42,8 +42,8 @@ __getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) else { real = _hurd_id.aux.uids[0]; - saved = _hurd_id.aux.nuids < 2 ? real :_hurd_id.aux.uids[1]; eff = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0]; + saved = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1]; } } @@ -53,8 +53,8 @@ __getresuid (uid_t *euid, uid_t *ruid, uid_t *suid) if (err) return __hurd_fail (err); - *euid = eff; *ruid = real; + *euid = eff; *suid = saved; return 0; } diff --git a/sysdeps/mach/hurd/mips/bits/sigcontext.h b/sysdeps/mach/hurd/mips/bits/sigcontext.h deleted file mode 100644 index 14c618857e..0000000000 --- a/sysdeps/mach/hurd/mips/bits/sigcontext.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. MIPS version. - Copyright (C) 1994,97,2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H -# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." -#endif - -#ifndef sc_mips_thread_state - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to: - { - struct mips_thread_state ts; - struct mips_exc_state es; - struct mips_float_state fs; - } - trampoline.c knows this, so it must be changed if this changes. */ -#define sc_mips_thread_state sc_gpr /* Beginning of correspondence. */ - int sc_gpr[31]; /* "General" registers; [0] is r1. */ - int sc_mdlo, sc_mdhi; /* Low and high multiplication results. */ - int sc_pc; /* Instruction pointer. */ - - /* struct mips_exc_state */ -#define sc_mips_exc_state sc_cause - unsigned int sc_cause; /* Machine-level trap code. */ -#define SC_CAUSE_SST 0x00000044 - unsigned int sc_badvaddr; - unsigned int sc_coproc_used; /* Which coprocessors the thread has used. */ -#define SC_COPROC_USE_COP0 1 /* (by definition) */ -#define SC_COPROC_USE_COP1 2 /* FPA */ -#define SC_COPROC_USE_FPU SC_COPROC_USE_COP1 -#define SC_COPROC_USE_COP2 4 -#define SC_COPROC_USE_COP3 8 - - /* struct mips_float_state - This is only filled in if the SC_COPROC_USE_FPU bit - is set in sc_coproc_used. */ -#define sc_mips_float_state sc_fpr - int sc_fpr[32]; /* FP registers. */ - int sc_fpcsr; /* FPU status register. */ - int sc_fpeir; /* FP exception instruction register. */ - }; - -#endif /* sc_mips_thread_state */ diff --git a/sysdeps/mach/hurd/mips/dl-machine.c b/sysdeps/mach/hurd/mips/dl-machine.c deleted file mode 100644 index ce2d5db510..0000000000 --- a/sysdeps/mach/hurd/mips/dl-machine.c +++ /dev/null @@ -1,132 +0,0 @@ -/* Operating system support for run-time dynamic linker. MIPS specific - stuffs on Hurd. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd.h> -#include <link.h> -#include <unistd.h> -#include <fcntl.h> -#include <stdlib.h> -#include <sys/mman.h> -#include <assert.h> -#include <sysdep.h> -#include <mach/mig_support.h> -#include "../stdio-common/_itoa.h" -#include <stdarg.h> -#include <ctype.h> -#include <sys/stat.h> -#include <libintl.h> - -void weak_function -abort (void) -{ - _exit (127); -} - - -#include <string.h> -#include <mach/error.h> -#include <errorlib.h> - -#undef _ -#define _(x) x - -/* Return a string describing the errno code in ERRNUM. */ -char * weak_function -_strerror_internal (int errnum, char *buf, size_t buflen) -{ - int system; - int sub; - int code; - const struct error_system *es; - extern void __mach_error_map_compat (int *); - - __mach_error_map_compat (&errnum); - - system = err_get_system (errnum); - sub = err_get_sub (errnum); - code = err_get_code (errnum); - - if (system > err_max_system || ! __mach_error_systems[system].bad_sub) - { - const char *unk = _("Error in unknown error system: "); - const size_t unklen = strlen (unk); - char *p = buf + buflen; - *--p = '\0'; - p = _itoa (errnum, p, 16, 1); - return memcpy (p - unklen, unk, unklen); - } - - es = &__mach_error_systems[system]; - - if (sub >= es->max_sub) - return (char *) es->bad_sub; - - if (code >= es->subsystem[sub].max_code) - { - const char *unk = _("Unknown error "); - const size_t unklen = strlen (unk); - char *p = buf + buflen; - size_t len = strlen (es->subsystem[sub].subsys_name); - *--p = '\0'; - p = _itoa (errnum, p, 16, 1); - *p-- = ' '; - p = memcpy (p - len, es->subsystem[sub].subsys_name, len); - return memcpy (p - unklen, unk, unklen); - } - - return (char *) _(es->subsystem[sub].codes[code]); -} - -/* Read the whole contents of FILE into new mmap'd space with given - protections. The size of the file is returned in SIZE. */ -void * -_dl_sysdep_read_whole_file (const char *file, size_t *size, int prot) -{ - struct stat stat; - mach_port_t memobj_rd; - void *contents; - error_t err; - - memobj_rd = __open (file, O_RDONLY, 0); - if (memobj_rd) - { - err = __io_stat ((file_t) memobj_rd, &stat); - if (err) - { - __hurd_fail (err); - contents = 0; - } - else - { - /* Map a copy of the file contents. */ - contents = __mmap (0, stat.st_size, prot, MAP_COPY, memobj_rd, 0); - if (contents == (void *)-1) - contents = 0; - else - *size = stat.st_size; - } - - __mach_port_deallocate (__mach_task_self (), memobj_rd); - } - else - contents = 0; - - return contents; -} diff --git a/sysdeps/mach/hurd/mips/exc2signal.c b/sysdeps/mach/hurd/mips/exc2signal.c deleted file mode 100644 index c505ae5b22..0000000000 --- a/sysdeps/mach/hurd/mips/exc2signal.c +++ /dev/null @@ -1,97 +0,0 @@ -/* Translate Mach exception codes into signal numbers. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd.h> -#include <hurd/signal.h> -#include <mach/exception.h> - -/* Translate the Mach exception codes, as received in an `exception_raise' RPC, - into a signal number and signal subcode. */ - -void -_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo) -{ - detail->error = 0; - - switch (detail->exc) - { - default: - *signo = SIGIOT; - detail->code = detail->exc; - break; - - case EXC_BAD_ACCESS: - if (detail->exc_code == KERN_PROTECTION_FAILURE) - *signo = SIGSEGV; - else - *signo = SIGBUS; - detail->code = detail->exc_subcode; - detail->error = detail->exc_code; - break; - - case EXC_BAD_INSTRUCTION: - *signo = SIGILL; - if (detail->exc_code == EXC_MIPS_II) - detail->code = detail->exc_subcode; - else - detail->code = 0; - break; - - case EXC_ARITHMETIC: - switch (detail->exc_code) - { - case EXC_MIPS_OV: /* integer overflow */ - *signo = SIGFPE; - detail->code = detail->exc_subcode; - break; - - default: - *signo = SIGFPE; - detail->code = 0; - break; - - case EXC_MIPS_INT: - /* Subcode is the fp_status word saved by the hardware. - Give an error code corresponding to the first bit set. */ - if (detail->exc_subcode == EXC_MIPS_FLT_UNIMP) - *signo = SIGILL; - else - *signo = SIGFPE; - detail->code = detail->exc_subcode; - break; - } - break; - - case EXC_EMULATION: - /* 3.0 doesn't give this one, why, I don't know. */ - *signo = SIGEMT; - detail->code = 0; - break; - - case EXC_SOFTWARE: - *signo = SIGEMT; - detail->code = 0; - break; - - case EXC_BREAKPOINT: - *signo = SIGTRAP; - detail->code = 0; - break; - } -} diff --git a/sysdeps/mach/hurd/mips/init-fault.c b/sysdeps/mach/hurd/mips/init-fault.c deleted file mode 100644 index 05f48a3a56..0000000000 --- a/sysdeps/mach/hurd/mips/init-fault.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Set up a thread_state for proc_handle_exceptions. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd/signal.h> -#include <mach/thread_status.h> -#include <string.h> -#include <setjmp.h> - -extern jmp_buf _hurd_sigthread_fault_env; - -static char fault_stack[32]; -static volatile void -faulted (void) -{ - __longjmp (_hurd_sigthread_fault_env, 1); -} - -void -_hurd_initialize_fault_recovery_state (void *state) -{ - struct mips_thread_state *ts = state; - memset (ts, 0, sizeof (*ts)); - ts->r29 = (int) &fault_stack[sizeof (fault_stack)]; - ts->pc = (int) &faulted; -} diff --git a/sysdeps/mach/hurd/mips/init-first.c b/sysdeps/mach/hurd/mips/init-first.c deleted file mode 100644 index 6f53e839b3..0000000000 --- a/sysdeps/mach/hurd/mips/init-first.c +++ /dev/null @@ -1,414 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. For Mips/Hurd. - Copyright (C) 1996,1997,1998,2000,01,02,03 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd.h> -#include <stdio.h> -#include <unistd.h> -#include <string.h> -#include "hurdstartup.h" -#include "set-hooks.h" -#include "hurdmalloc.h" /* XXX */ - -extern void __mach_init (void); -extern void __init_misc (int, char **, char **); -#ifdef USE_NONOPTION_FLAGS -extern void __getopt_clean_environment (char **); -#endif -#ifndef SHARED -extern void _dl_non_dynamic_init (void) internal_function; -#endif -extern void __libc_global_ctors (void); - -unsigned int __hurd_threadvar_max; -unsigned long int __hurd_threadvar_stack_offset; -unsigned long int __hurd_threadvar_stack_mask; - -int __libc_multiple_libcs attribute_hidden = 1; - -int __libc_argc attribute_hidden; -char **__libc_argv attribute_hidden; - -void *(*_cthread_init_routine) (void); /* Returns new SP to use. */ -void (*_cthread_exit_routine) (int status) __attribute__ ((__noreturn__)); - - -/* Things that want to be run before _hurd_init or much anything else. - Importantly, these are called before anything tries to use malloc. */ -DEFINE_HOOK (_hurd_preinit_hook, (void)); - -static void -init1 (int argc, char *arg0, ...) -{ - char **argv = &arg0; - char **envp = &argv[argc + 1]; - struct hurd_startup_data *d; - - __libc_argc = argc; - __libc_argv = argv; - __environ = envp; - while (*envp) - ++envp; - d = (void *) ++envp; - - /* If we are the bootstrap task started by the kernel, - then after the environment pointers there is no Hurd - data block; the argument strings start there. */ - if ((void *) d != argv[0]) - { - _hurd_init_dtable = d->dtable; - _hurd_init_dtablesize = d->dtablesize; - - { - /* Check if the stack we are now on is different from - the one described by _hurd_stack_{base,size}. */ - - char dummy; - const vm_address_t newsp = (vm_address_t) &dummy; - - if (d->stack_size != 0 && (newsp < d->stack_base || - newsp - d->stack_base > d->stack_size)) - /* The new stack pointer does not intersect with the - stack the exec server set up for us, so free that stack. */ - __vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size); - } - } - - if (__hurd_threadvar_stack_mask == 0) - { - /* We are not using cthreads, so we will have just a single allocated - area for the per-thread variables of the main user thread. */ - unsigned long int i; - __hurd_threadvar_stack_offset - = (unsigned long int) malloc (__hurd_threadvar_max * - sizeof (unsigned long int)); - if (__hurd_threadvar_stack_offset == 0) - __libc_fatal ("Can't allocate single-threaded per-thread variables."); - for (i = 0; i < __hurd_threadvar_max; ++i) - ((unsigned long int *) __hurd_threadvar_stack_offset)[i] = 0; - } - - if ((void *) d != argv[0] && (d->portarray || d->intarray)) - /* Initialize library data structures, start signal processing, etc. */ - _hurd_init (d->flags, argv, - d->portarray, d->portarraysize, - d->intarray, d->intarraysize); - -#ifndef SHARED - _dl_non_dynamic_init (); -#endif - __init_misc (argc, argv, __environ); - -#ifdef USE_NONOPTION_FLAGS - /* This is a hack to make the special getopt in GNU libc working. */ - __getopt_clean_environment (envp); -#endif - -#ifdef SHARED - __libc_global_ctors (); -#endif - - (void) &init1; -} - -static void * -__init (int *data) -{ - int argc = *data; - char **argv = (void *) (data + 1); - char **envp = &argv[argc + 1]; - struct hurd_startup_data *d; - - __environ = envp; - while (*envp) - ++envp; - d = (void *) ++envp; - - /* The user might have defined a value for this, to get more variables. - Otherwise it will be zero on startup. We must make sure it is set - properly before before cthreads initialization, so cthreads can know - how much space to leave for thread variables. */ - if (__hurd_threadvar_max < _HURD_THREADVAR_MAX) - __hurd_threadvar_max = _HURD_THREADVAR_MAX; - - - /* After possibly switching stacks, call `init1' (above) with the user - code as the return address, and the argument data immediately above - that on the stack. */ - - if (_cthread_init_routine) - { - /* Initialize cthreads, which will allocate us a new stack to run on. */ - void *newsp = (*_cthread_init_routine) (); - struct hurd_startup_data *od; - - /* Copy the argdata from the old stack to the new one. */ - newsp = memcpy (newsp - ((char *) &d[1] - (char *) data), data, - (char *) d - (char *) data); - - /* Set up the Hurd startup data block immediately following - the argument and environment pointers on the new stack. */ - od = (newsp + ((char *) d - (char *) data)); - if ((void *) argv[0] == d) - /* We were started up by the kernel with arguments on the stack. - There is no Hurd startup data, so zero the block. */ - memset (od, 0, sizeof *od); - else - /* Copy the Hurd startup data block to the new stack. */ - *od = *d; - - /* Push the user code address on the top of the new stack. It will - be the return address for `init1'; we will jump there with NEWSP - as the stack pointer. */ - return newsp; - } - - /* The argument data is just above the stack frame we will unwind by - returning. */ - return (void *) data; - - (void) &__init; -} - -#ifdef SHARED -/* This function is called to initialize the shared C library. - It is called just before the user _start code from mips/elf/start.S, - with the stack set up as that code gets it. */ - -/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT - pointer in the dynamic section based solely on that. It is convention - for this function to be in the `.init' section, but the symbol name is - the only thing that really matters!! */ -/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ - -#if __mips64 -asm ("\ - .section .init,\"ax\",@progbits\n\ - .align 3\n\ - .globl _init\n\ - .type _init,@function\n\ - .ent _init\n\ -_init:\n\ - .set noreorder\n\ - .cpload $25\n\ - .set reorder\n\ - dsubu $29, 8*8\n\ - .cprestore 6*8\n\ - sd $16, 4*8($29)\n\ - sd $31, 5*8($29)\n\ - jal preinit\n\ - sd $28, 6*8($29)\n\ - move $16, $29 # Save the old stack pointer to s0 ($16)\n\ - daddu $4, $29, 4*8\n\ - jal __init\n\ - # Restore saved registers from the old stack.\n\ - ld $28, 6*8($16)\n\ - ld $31, 5*8($16)\n\ - ld $16, 4*8($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - dla $25, init1\n\ - jr $25\n\ - .end _init\n\ - .text\n\ -"); -#else -asm ("\ - .section .init,\"ax\",@progbits\n\ - .align 2\n\ - .globl _init\n\ - .type _init,@function\n\ - .ent _init\n\ -_init:\n\ - .set noreorder\n\ - .cpload $25\n\ - .set reorder\n\ - subu $29, 32\n\ - .cprestore 24\n\ - sw $16, 16($29)\n\ - sw $31, 20($29)\n\ - jal preinit\n\ - sw $28, 24($29)\n\ - move $16, $29 # Save the old stack pointer to s0 ($16)\n\ - addu $4, $29, 32\n\ - jal __init\n\ - # Restore saved registers from the old stack.\n\ - lw $28, 24($16)\n\ - lw $31, 20($16)\n\ - lw $16, 16($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - la $25, init1\n\ - jr $25\n\ - .end _init\n\ - .text\n\ -"); -#endif - -static void -preinit (void) -{ - /* Initialize data structures so we can do RPCs. */ - __mach_init (); - - RUN_HOOK (_hurd_preinit_hook, ()); - - (void) &preinit; -} - -void __libc_init_first (int argc, ...) -{ -} -#endif - -#ifndef SHARED -/* An assembler code wrapping c function __init. */ -#ifdef __mips64 -asm ("\ - .text\n\ - .align 3\n\ -init:\n\ - dsubu $29, 8*8\n\ - sd $16, 4*8($29)\n\ - sd $31, 5*8($29)\n\ - move $16, $29\n\ - jal __init\n\ - ld $31, 5*8($16)\n\ - ld $16, 4*8($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - dla $25, init1\n\ - jr $25\n\ -"); -#else -asm ("\ - .text\n\ - .align 2\n\ -init:\n\ - subu $29, 32\n\ - sw $16, 16($29)\n\ - sw $31, 20($29)\n\ - move $16, $29\n\ - jal __init\n\ - lw $31, 20($16)\n\ - lw $16, 16($16)\n\ - move $29, $2 # set new sp to SP\n\ -call_init1:\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - la $25, init1\n\ - jr $25\n\ -"); -#endif - -/* An assembler code wrapping c function ___libc_init_first. - ___libc_init_first does an RPC call to flush cache to put doinit - function on the stack, so we should call __mach_init first in - this wrap. */ -#ifdef __mips64 -asm ("\ - .text\n\ - .align 3\n\ - .globl __libc_init_first\n\ -__libc_init_first:\n\ - dsubu $29, 8\n\ - sd $31, 0($29)\n\ - jal __mach_init\n\ - ld $4, 0($29)\n\ - ld $5, 1*8($29)\n\ - ld $6, 2*8($29)\n\ - ld $7, 3*8($29)\n\ - j ___libc_init_first\n\ -"); -#else -asm ("\ - .text\n\ - .align 2\n\ - .globl __libc_init_first\n\ -__libc_init_first:\n\ - subu $29, 4\n\ - sw $31, 0($29)\n\ - jal __mach_init\n\ - lw $4, 0($29)\n\ - lw $5, 4($29)\n\ - lw $6, 8($29)\n\ - lw $7, 12($29)\n\ - j ___libc_init_first\n\ -"); -#endif - -static void -___libc_init_first (int return_addr, int argc, ...) -{ - void doinit (int *data) - { -#if 0 - /* This function gets called with the argument data at TOS. */ - void doinit1 (int argc, ...) - { - init (&argc); - } -#endif - extern void init (int *data); - - /* Push the user return address after the argument data, and then - jump to `doinit1' (above), so it is as if __libc_init_first's - caller had called `init' with the argument data already on the - stack. */ - *--data = return_addr; - -#ifdef __mips64 - asm volatile ("ld $31, 0(%0)\n" /* Load the original return address. */ - "daddu $29, %0, 8\n" /* Switch to new outermost stack. */ - "move $4, $29\n" - "jr %1" : : "r" (data), "r" (&init)); -#else - asm volatile ("lw $31, 0(%0)\n" /* Load the original return address. */ - "addu $29, %0, 4\n" /* Switch to new outermost stack. */ - "move $4, $29\n" - "jr %1" : : "r" (data), "r" (&init)); -#endif - /* NOTREACHED */ - } - -#if 0 - /* Initialize data structures so we can do RPCs. */ - __mach_init (); -#endif - - RUN_HOOK (_hurd_preinit_hook, ()); - - _hurd_startup ((void **) &argc, &doinit); - - (void) &___libc_init_first; -} -#endif diff --git a/sysdeps/mach/hurd/mips/intr-msg.h b/sysdeps/mach/hurd/mips/intr-msg.h deleted file mode 100644 index 16c78972ac..0000000000 --- a/sysdeps/mach/hurd/mips/intr-msg.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Machine-dependent details of interruptible RPC messaging. Mips version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -#ifdef __mips64 -#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ -({ \ - error_t err; \ - mach_port_t __rcv_name = (rcv_name); \ - mach_msg_timeout_t __timeout = (timeout); \ - mach_port_t __notify = (notify); \ - asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ - ".globl _hurd_intr_rpc_msg_in_trap\n" \ - " move $4, %1\n" \ - " move $5, %2\n" \ - " move $6, %3\n" \ - " move $7, %4\n" \ - " move $8, %5\n" \ - " move $9, %6\n" \ - " move $10, %7\n" \ - " dli $2, -25\n" \ - "_hurd_intr_rpc_msg_do_trap: syscall\n" \ - "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ - : "=r" (err) \ - : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ - "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ - "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ - err; \ -}) -#else -#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ -({ \ - error_t err; \ - mach_port_t __rcv_name = (rcv_name); \ - mach_msg_timeout_t __timeout = (timeout); \ - mach_port_t __notify = (notify); \ - asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ - ".globl _hurd_intr_rpc_msg_in_trap\n" \ - " move $4, %1\n" \ - " move $5, %2\n" \ - " move $6, %3\n" \ - " move $7, %4\n" \ - " move $8, %5\n" \ - " move $9, %6\n" \ - " move $10, %7\n" \ - " li $2, -25\n" \ - "_hurd_intr_rpc_msg_do_trap: syscall\n" \ - "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ - : "=r" (err) \ - : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ - "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ - "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ - err; \ -}) -#endif - -static inline void -INTR_MSG_BACK_OUT (struct mips_thread_state *state) -{ - return; -} - -#include "hurdfault.h" - -static inline int -SYSCALL_EXAMINE (struct mips_thread_state *state, int *callno) -{ - u_int32_t *p = (void *) (state->pc - 4); - int result; - if (_hurdsig_catch_memory_fault (p)) - return 0; - if (result = (*p == 0x0000000c)) - /* The PC is just after a `syscall' instruction. - This is a system call in progress; v0($2) holds the call number. */ - *callno = state->r2; - _hurdsig_end_catch_fault (); - return result; -} - - -struct mach_msg_trap_args - { - /* This is the order of arguments to mach_msg_trap. */ - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t timeout; - mach_port_t notify; - }; - - -static inline mach_port_t -MSG_EXAMINE (struct mips_thread_state *state, int *msgid) -{ - mach_msg_header_t *msg; - mach_port_t send_port; - - msg = (mach_msg_header_t *) state->r4; - - if (_hurdsig_catch_memory_fault (msg)) - return MACH_PORT_NULL; - send_port = msg->msgh_remote_port; - *msgid = msg->msgh_id; - _hurdsig_end_catch_fault (); - - return send_port; -} diff --git a/sysdeps/mach/hurd/mips/longjmp-ctx.c b/sysdeps/mach/hurd/mips/longjmp-ctx.c deleted file mode 100644 index 66ee7b6fb8..0000000000 --- a/sysdeps/mach/hurd/mips/longjmp-ctx.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Perform a `longjmp' on a `struct sigcontext'. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> -#include <hurd/signal.h> -#include <string.h> - -void -_hurd_longjmp_sigcontext (struct sigcontext *scp, jmp_buf env, int retval) -{ - scp->sc_gpr[16] = env[0].__regs[0]; - scp->sc_gpr[17] = env[0].__regs[1]; - scp->sc_gpr[18] = env[0].__regs[2]; - scp->sc_gpr[19] = env[0].__regs[3]; - scp->sc_gpr[20] = env[0].__regs[4]; - scp->sc_gpr[21] = env[0].__regs[5]; - scp->sc_gpr[22] = env[0].__regs[6]; - scp->sc_gpr[23] = env[0].__regs[7]; - - scp->sc_gpr[28] = (int) env[0].__gp; - scp->sc_fp = (int) env[0].__fp; - scp->sc_sp = (int) env[0].__sp; - scp->sc_pc = (int) env[0].__pc; - scp->sc_gpr[2] = retval ?: 1; -} diff --git a/sysdeps/mach/hurd/mips/longjmp-ts.c b/sysdeps/mach/hurd/mips/longjmp-ts.c deleted file mode 100644 index 4c69e4e2b9..0000000000 --- a/sysdeps/mach/hurd/mips/longjmp-ts.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Perform a `longjmp' on a Mach thread_state. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd/signal.h> -#include <setjmp.h> -#include <mach/thread_status.h> - - -/* Set up STATE to do the equivalent of `longjmp (ENV, VAL);'. */ - -void -_hurd_longjmp_thread_state (void *state, jmp_buf env, int val) -{ - struct mips_thread_state *ts = state; - - ts->r16 = env[0].__jmpbuf[0].__regs[0]; - ts->r17 = env[0].__jmpbuf[0].__regs[1]; - ts->r18 = env[0].__jmpbuf[0].__regs[2]; - ts->r19 = env[0].__jmpbuf[0].__regs[3]; - ts->r20 = env[0].__jmpbuf[0].__regs[4]; - ts->r21 = env[0].__jmpbuf[0].__regs[5]; - ts->r22 = env[0].__jmpbuf[0].__regs[6]; - ts->r23 = env[0].__jmpbuf[0].__regs[7]; - ts->r28 = (int) env[0].__jmpbuf[0].__gp; - ts->r29 = (int) env[0].__jmpbuf[0].__sp; - ts->r30 = (int) env[0].__jmpbuf[0].__fp; - ts->pc = (int) env[0].__jmpbuf[0].__pc; - ts->r2 = val ?: 1; -} diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c deleted file mode 100644 index a9f7673eb5..0000000000 --- a/sysdeps/mach/hurd/mips/sigreturn.c +++ /dev/null @@ -1,223 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd.h> -#include <hurd/signal.h> -#include <hurd/threadvar.h> -#include <stdlib.h> -#include <mach/mips/mips_instruction.h> - -int -__sigreturn (struct sigcontext *scp) -{ - struct hurd_sigstate *ss; - struct hurd_userlink *link = (void *) &scp[1]; - mach_port_t *reply_port; - - if (scp == NULL || (scp->sc_mask & _SIG_CANT_MASK)) - { - errno = EINVAL; - return -1; - } - - ss = _hurd_self_sigstate (); - __spin_lock (&ss->lock); - - /* Remove the link on the `active resources' chain added by - _hurd_setup_sighandler. Its purpose was to make sure - that we got called; now we have, it is done. */ - _hurd_userlink_unlink (link); - - /* Restore the set of blocked signals, and the intr_port slot. */ - ss->blocked = scp->sc_mask; - ss->intr_port = scp->sc_intr_port; - - /* Check for pending signals that were blocked by the old set. */ - if (ss->pending & ~ss->blocked) - { - /* There are pending signals that just became unblocked. Wake up the - signal thread to deliver them. But first, squirrel away SCP where - the signal thread will notice it if it runs another handler, and - arrange to have us called over again in the new reality. */ - ss->context = scp; - __spin_unlock (&ss->lock); - __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ()); - /* If a pending signal was handled, sig_post never returned. */ - __spin_lock (&ss->lock); - ss->context = NULL; - } - - if (scp->sc_onstack) - { - ss->sigaltstack.ss_flags &= ~SS_ONSTACK; /* XXX threadvars */ - /* XXX cannot unlock until off sigstack */ - abort (); - } - else - __spin_unlock (&ss->lock); - - /* Destroy the MiG reply port used by the signal handler, and restore the - reply port in use by the thread when interrupted. */ - reply_port = - (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY); - if (*reply_port) - { - mach_port_t port = *reply_port; - - /* Assigning MACH_PORT_DEAD here tells libc's mig_get_reply_port not to - get another reply port, but avoids mig_dealloc_reply_port trying to - deallocate it after the receive fails (which it will, because the - reply port will be bogus, whether we do this or not). */ - *reply_port = MACH_PORT_DEAD; - - __mach_port_destroy (__mach_task_self (), port); - } - *reply_port = scp->sc_reply_port; - - if (scp->sc_coproc_used & SC_COPROC_USE_FPU) - { - /* Restore FPU state. */ -#define restore_fpr(n) \ - asm volatile ("l.d $f" #n ",%0" : : "m" (scp->sc_fpr[n])) - - /* Restore floating-point registers. */ -#ifdef __mips64 - restore_fpr (0); - restore_fpr (1); - restore_fpr (2); - restore_fpr (3); - restore_fpr (4); - restore_fpr (5); - restore_fpr (6); - restore_fpr (7); - restore_fpr (8); - restore_fpr (9); - restore_fpr (10); - restore_fpr (11); - restore_fpr (12); - restore_fpr (13); - restore_fpr (14); - restore_fpr (15); - restore_fpr (16); - restore_fpr (17); - restore_fpr (18); - restore_fpr (19); - restore_fpr (20); - restore_fpr (21); - restore_fpr (22); - restore_fpr (23); - restore_fpr (24); - restore_fpr (25); - restore_fpr (26); - restore_fpr (27); - restore_fpr (28); - restore_fpr (29); - restore_fpr (30); - restore_fpr (31); -#else - restore_fpr (0); - restore_fpr (2); - restore_fpr (4); - restore_fpr (6); - restore_fpr (8); - restore_fpr (10); - restore_fpr (12); - restore_fpr (14); - restore_fpr (16); - restore_fpr (18); - restore_fpr (20); - restore_fpr (22); - restore_fpr (24); - restore_fpr (26); - restore_fpr (28); - restore_fpr (30); -#endif - - /* Restore the floating-point control/status register ($f31). */ - asm volatile ("ctc1 %0,$f31" : : "r" (scp->sc_fpcsr)); - } - - /* Load all the registers from the sigcontext. */ -#ifdef __mips64 -#define restore_gpr(n) \ - asm volatile ("ld $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) -#else -#define restore_gpr(n) \ - asm volatile ("lw $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) -#endif - - { - register const struct sigcontext *const scpreg asm ("$1") = scp; - register int *at asm ("$1"); - - /* First restore the multiplication result registers. The compiler - will use some temporary registers, so we do this before restoring - the general registers. */ - asm volatile ("mtlo %0" : : "r" (scpreg->sc_mdlo)); - asm volatile ("mthi %0" : : "r" (scpreg->sc_mdhi)); - - /* In the word after the saved PC, store the saved $1 value. */ - (&scpreg->sc_pc)[1] = scpreg->sc_gpr[0]; - - asm volatile (".set noreorder; .set noat;"); - - /* Restore the normal registers. */ - restore_gpr (2); - restore_gpr (3); - restore_gpr (4); - restore_gpr (5); - restore_gpr (6); - restore_gpr (7); - restore_gpr (8); - restore_gpr (9); - restore_gpr (10); - restore_gpr (11); - restore_gpr (12); - restore_gpr (13); - restore_gpr (14); - restore_gpr (15); - restore_gpr (16); - restore_gpr (17); - restore_gpr (18); - restore_gpr (19); - restore_gpr (20); - restore_gpr (21); - restore_gpr (22); - restore_gpr (23); - restore_gpr (24); - restore_gpr (25); - /* Registers 26-27 are kernel-only. */ - restore_gpr (28); - restore_gpr (29); /* Stack pointer. */ - restore_gpr (30); /* Frame pointer. */ - restore_gpr (31); /* Return address. */ - - at = &scpreg->sc_pc; - /* This is an emulated instruction that will find at the address in $1 - two words: the PC value to restore, and the $1 value to restore. */ - asm volatile (".word %0" : : "i" (op_sigreturn)); - asm volatile (".set reorder; .set at;"); - /* NOTREACHED */ - return at; /* To prevent optimization. */ - } - - /* NOTREACHED */ - return -1; -} - -weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/mach/hurd/mips/trampoline.c b/sysdeps/mach/hurd/mips/trampoline.c deleted file mode 100644 index 34e363b1aa..0000000000 --- a/sysdeps/mach/hurd/mips/trampoline.c +++ /dev/null @@ -1,292 +0,0 @@ -/* Set thread_state for sighandler, and sigcontext to recover. MIPS version. - Copyright (C) 1996, 1997, 1998, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <hurd/signal.h> -#include <hurd/userlink.h> -#include <thread_state.h> -#include <assert.h> -#include <errno.h> -#include "hurdfault.h" -#include <intr-msg.h> - - -struct sigcontext * -_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, - int signo, struct hurd_signal_detail *detail, - volatile int rpc_wait, - struct machine_thread_all_state *state) -{ - __label__ trampoline, rpc_wait_trampoline, firewall; - void *volatile sigsp; - struct sigcontext *scp; - struct - { - int signo; - long int sigcode; - struct sigcontext *scp; /* Points to ctx, below. */ - void *sigreturn_addr; - void *sigreturn_returns_here; - struct sigcontext *return_scp; /* Same; arg to sigreturn. */ - struct sigcontext ctx; - struct hurd_userlink link; - } *stackframe; - - if (ss->context) - { - /* We have a previous sigcontext that sigreturn was about - to restore when another signal arrived. We will just base - our setup on that. */ - if (! _hurdsig_catch_memory_fault (ss->context)) - { - memcpy (&state->basic, &ss->context->sc_mips_thread_state, - sizeof (state->basic)); - memcpy (&state->exc, &ss->context->sc_mips_exc_state, - sizeof (state->exc)); - state->set = (1 << MIPS_THREAD_STATE) | (1 << MIPS_EXC_STATE); - if (state->exc.coproc_state & SC_COPROC_USE_FPU) - { - memcpy (&state->fpu, &ss->context->sc_mips_float_state, - sizeof (state->fpu)); - state->set |= (1 << MIPS_FLOAT_STATE); - } - } - } - - if (! machine_get_basic_state (ss->thread, state)) - return NULL; - - /* Save the original SP in the gratuitous s0 ($16) slot. - We may need to reset the SP (the `r29' slot) to avoid clobbering an - interrupted RPC frame. */ - state->basic.r16 = state->basic.r29; - - if ((ss->actions[signo].sa_flags & SA_ONSTACK) && - !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) - { - sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size; - ss->sigaltstack.ss_flags |= SS_ONSTACK; - /* XXX need to set up base of new stack for - per-thread variables, cthreads. */ - } - else - sigsp = (char *) state->basic.r29; - - /* Push the arguments to call `trampoline' on the stack. */ - sigsp -= sizeof (*stackframe); - stackframe = sigsp; - - if (_hurdsig_catch_memory_fault (stackframe)) - { - /* We got a fault trying to write the stack frame. - We cannot set up the signal handler. - Returning NULL tells our caller, who will nuke us with a SIGILL. */ - return NULL; - } - else - { - int ok; - - extern void _hurdsig_longjmp_from_handler (void *, jmp_buf, int); - - /* Add a link to the thread's active-resources list. We mark this as - the only user of the "resource", so the cleanup function will be - called by any longjmp which is unwinding past the signal frame. - The cleanup function (in sigunwind.c) will make sure that all the - appropriate cleanups done by sigreturn are taken care of. */ - stackframe->link.cleanup = &_hurdsig_longjmp_from_handler; - stackframe->link.cleanup_data = &stackframe->ctx; - stackframe->link.resource.next = NULL; - stackframe->link.resource.prevp = NULL; - stackframe->link.thread.next = ss->active_resources; - stackframe->link.thread.prevp = &ss->active_resources; - if (stackframe->link.thread.next) - stackframe->link.thread.next->thread.prevp - = &stackframe->link.thread.next; - ss->active_resources = &stackframe->link; - - /* Set up the arguments for the signal handler. */ - stackframe->signo = signo; - stackframe->sigcode = detail->code; - stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx; - stackframe->sigreturn_addr = &__sigreturn; - stackframe->sigreturn_returns_here = &&firewall; /* Crash on return. */ - - /* Set up the sigcontext from the current state of the thread. */ - - scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0; - - /* struct sigcontext is laid out so that starting at sc_gpr - mimics a struct mips_thread_state. */ - memcpy (&scp->sc_mips_thread_state, - &state->basic, sizeof (state->basic)); - - /* struct sigcontext is laid out so that starting at sc_cause - mimics a struct mips_exc_state. */ - ok = machine_get_state (ss->thread, state, MIPS_EXC_STATE, - &state->exc, &scp->sc_cause, - sizeof (state->exc)); - - if (ok && (scp->sc_coproc_used & SC_COPROC_USE_FPU)) - /* struct sigcontext is laid out so that starting at sc_fpr - mimics a struct mips_float_state. This state - is only meaningful if the coprocessor was used. */ - ok = machine_get_state (ss->thread, state, MIPS_FLOAT_STATE, - &state->fpu, &scp->sc_mips_float_state, - sizeof (state->fpu)); - - _hurdsig_end_catch_fault (); - - if (! ok) - return NULL; - } - - /* Modify the thread state to call the trampoline code on the new stack. */ - if (rpc_wait) - { - /* The signalee thread was blocked in a mach_msg_trap system call, - still waiting for a reply. We will have it run the special - trampoline code which retries the message receive before running - the signal handler. - - To do this we change the OPTION argument in its registers to - enable only message reception, since the request message has - already been sent. */ - - /* The system call arguments are stored in consecutive registers - starting with a0 ($4). */ - struct mach_msg_trap_args *args = (void *) &state->basic.r4; - - if (_hurdsig_catch_memory_fault (args)) - { - /* Faulted accessing ARGS. Bomb. */ - return NULL; - } - - assert (args->option & MACH_RCV_MSG); - /* Disable the message-send, since it has already completed. The - calls we retry need only wait to receive the reply message. */ - args->option &= ~MACH_SEND_MSG; - - /* Limit the time to receive the reply message, in case the server - claimed that `interrupt_operation' succeeded but in fact the RPC - is hung. */ - args->option |= MACH_RCV_TIMEOUT; - args->timeout = _hurd_interrupted_rpc_timeout; - - _hurdsig_end_catch_fault (); - - state->basic.pc = (int) &&rpc_wait_trampoline; - /* The reply-receiving trampoline code runs initially on the original - user stack. We pass it the signal stack pointer in s4 ($20). */ - state->basic.r29 = state->basic.r16; /* Restore mach_msg syscall SP. */ - state->basic.r20 = (int) sigsp; - /* After doing the message receive, the trampoline code will need to - update the v0 ($2) value to be restored by sigreturn. To simplify - the assembly code, we pass the address of its slot in SCP to the - trampoline code in s5 ($21). */ - state->basic.r21 = (int) &scp->sc_gpr[1]; - /* We must preserve the mach_msg_trap args in a0..t2 ($4..$10). - Pass the handler args to the trampoline code in s1..s3 ($17..$19). */ - state->basic.r17 = signo; - state->basic.r18 = detail->code; - state->basic.r19 = (int) scp; - } - else - { - state->basic.pc = (int) &&trampoline; - state->basic.r29 = (int) sigsp; - state->basic.r4 = signo; - state->basic.r5 = detail->code; - state->basic.r6 = (int) scp; - } - - /* We pass the handler function to the trampoline code in s6 ($22). */ - state->basic.r22 = (int) handler; - /* In the callee-saved register s0 ($16), we save the SCP value to pass - to __sigreturn after the handler returns. */ - state->basic.r16 = (int) scp; - - return scp; - - /* The trampoline code follows. This is not actually executed as part of - this function, it is just convenient to write it that way. */ - - rpc_wait_trampoline: - /* This is the entry point when we have an RPC reply message to receive - before running the handler. The MACH_MSG_SEND bit has already been - cleared in the OPTION argument in our registers. For our convenience, - $3 points to the sc_gpr[1] member of the sigcontext (saved v0 ($2)). */ - asm volatile - (".set noat; .set noreorder; .set nomacro\n" - /* Retry the interrupted mach_msg system call. */ -#ifdef __mips64 - "dli $2, -25\n" /* mach_msg_trap */ -#else - "li $2, -25\n" /* mach_msg_trap */ -#endif - "syscall\n" - /* When the sigcontext was saved, v0 was MACH_RCV_INTERRUPTED. But - now the message receive has completed and the original caller of - the RPC (i.e. the code running when the signal arrived) needs to - see the final return value of the message receive in v0. So - store the new v0 value into the sc_gpr[1] member of the sigcontext - (whose address is in s5 to make this code simpler). */ -#ifdef __mips64 - "sd $2, ($21)\n" -#else - "sw $2, ($21)\n" -#endif - /* Since the argument registers needed to have the mach_msg_trap - arguments, we've stored the arguments to the handler function - in registers s1..s3 ($17..$19). */ - "move $4, $17\n" - "move $5, $18\n" - "move $6, $19\n" - /* Switch to the signal stack. */ - "move $29, $20\n"); - - trampoline: - /* Entry point for running the handler normally. The arguments to the - handler function are already in the standard registers: - - a0 SIGNO - a1 SIGCODE - a2 SCP - */ - asm volatile - ("move $25, $22\n" /* Copy s6 to t9 for MIPS ABI. */ - "jal $25; nop\n" /* Call the handler function. */ - /* Call __sigreturn (SCP); this cannot return. */ -#ifdef __mips64 - "dla $1,%0\n" -#else - "la $1,%0\n" -#endif - "j $1\n" - "move $4, $16" /* Set up arg from saved SCP in delay slot. */ - : : "i" (&__sigreturn)); - - /* NOTREACHED */ - asm volatile (".set reorder; .set at; .set macro"); - - firewall: - asm volatile ("hlt: j hlt"); - - return NULL; -} diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c index 5e3c7f0836..8fcf26eaf1 100644 --- a/sysdeps/mach/hurd/setresgid.c +++ b/sysdeps/mach/hurd/setresgid.c @@ -1,5 +1,5 @@ -/* setresgid -- set effective group ID, real group ID, and saved-set group ID - Copyright (C) 2002, 2005 Free Software Foundation, Inc. +/* setresgid -- set real group ID, effective group ID, and saved-set group ID + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,10 +22,10 @@ #include <hurd.h> #include <hurd/id.h> -/* Set the effective group ID, real group ID, and saved-set group ID, - of the calling process to EGID, RGID, and SGID, respectively. */ +/* Set the real group ID, effective group ID, and saved-set group ID, + of the calling process to RGID, EGID, and SGID, respectively. */ int -__setresgid (gid_t egid, gid_t rgid, gid_t sgid) +__setresgid (gid_t rgid, gid_t egid, gid_t sgid) { auth_t newauth; error_t err; diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c index f9d76a95ca..ccf8d08d40 100644 --- a/sysdeps/mach/hurd/setresuid.c +++ b/sysdeps/mach/hurd/setresuid.c @@ -1,5 +1,5 @@ -/* setresuid -- set effective user ID, real user ID, and saved-set user ID - Copyright (C) 2002, 2005 Free Software Foundation, Inc. +/* setresuid -- set real user ID, effective user ID, and saved-set user ID + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,10 +22,10 @@ #include <hurd.h> #include <hurd/id.h> -/* Set the effective user ID, real user ID, and saved-set user ID, - of the calling process to EUID, RUID, and SUID, respectively. */ +/* Set the real user ID, effective user ID, and saved-set user ID, + of the calling process to RUID, EUID, and SUID, respectively. */ int -__setresuid (uid_t euid, uid_t ruid, uid_t suid) +__setresuid (uid_t ruid, uid_t euid, uid_t suid) { auth_t newauth; error_t err; diff --git a/sysdeps/mach/mips/Makefile b/sysdeps/mach/mips/Makefile deleted file mode 100644 index a890ae7b46..0000000000 --- a/sysdeps/mach/mips/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(subdir),gnulib) -sysdep_routines += cacheflush -endif diff --git a/sysdeps/mach/mips/cacheflush.c b/sysdeps/mach/mips/cacheflush.c deleted file mode 100644 index 2a283e3e89..0000000000 --- a/sysdeps/mach/mips/cacheflush.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Flush the insn cache after GCC writes a closure on the stack. Mach/MIPS. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <mach.h> -#include <mach/vm_attributes.h> - -/* Stupid name, but this is what GCC generates (config/mips/mips.h). */ -void -cacheflush (void *addr, unsigned size, int flag) -{ - vm_machine_attribute_val_t val; - - switch (flag) - { - case 0: /* ? */ - val = MATTR_VAL_DCACHE_FLUSH; - case 1: /* This is the only value GCC uses. */ - val = MATTR_VAL_ICACHE_FLUSH; - break; - default: - val = MATTR_VAL_CACHE_FLUSH; - } - - __vm_machine_attribute (__mach_task_self (), - (vm_address_t) addr, size, - MATTR_CACHE, - &val); -} diff --git a/sysdeps/mach/mips/machine-lock.h b/sysdeps/mach/mips/machine-lock.h deleted file mode 100644 index eccc720dfa..0000000000 --- a/sysdeps/mach/mips/machine-lock.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Machine-specific definition for spin locks. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_LOCK_H -#define _MACHINE_LOCK_H - -/* To get the TAS pseudo-instruction. */ -#include <mach/mips/mips_instruction.h> - -/* The type of a spin lock variable. */ - -typedef __volatile int __spin_lock_t; - -/* Value to initialize `__spin_lock_t' variables to. */ - -#define __SPIN_LOCK_INITIALIZER 0 - - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Unlock LOCK. */ - -_EXTERN_INLINE void -__spin_unlock (__spin_lock_t *__lock) -{ - *__lock = 0; -} - -/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */ - -_EXTERN_INLINE int -__spin_try_lock (register __spin_lock_t *__lock) -{ -#if (__mips >= 2) - int __rtn; - - __asm__ __volatile (".set noreorder"); -#if (__mips64) - __asm__ __volatile ("lld %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#else - __asm__ __volatile ("ll %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#endif - if (__rtn) - return 0; - __asm__ __volatile ("move %0,%1" : "=r" (__rtn) : "r" (__lock)); -#if (__mips64) - __asm__ __volatile ("scd %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#else - __asm__ __volatile ("sc %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); -#endif - __asm__ __volatile (".set reorder"); - return __rtn; -#else - register int __rtn __asm__ ("a0"); - - /* Use the Mach microkernel's emulated TAS pseudo-instruction. */ - __asm__ __volatile (".set noreorder"); - __asm__ __volatile (".word %1" : "=r" (__rtn) : "i" (op_tas), "0" (__lock)); - __asm__ __volatile ("nop"); - __asm__ __volatile (".set reorder"); - return __rtn ^ (int) __lock; -#endif -} - -/* Return nonzero if LOCK is locked. */ - -_EXTERN_INLINE int -__spin_lock_locked (__spin_lock_t *__lock) -{ - return *__lock != 0; -} - - -#endif /* machine-lock.h */ diff --git a/sysdeps/mach/mips/machine-sp.h b/sysdeps/mach/mips/machine-sp.h deleted file mode 100644 index 144356a39f..0000000000 --- a/sysdeps/mach/mips/machine-sp.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Machine-specific function to return the stack pointer. MIPS version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_SP_H -#define _MACHINE_SP_H - -/* Return the current stack pointer. */ - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -_EXTERN_INLINE void * -__thread_stack_pointer (void) -{ - void *__sp__; - __asm__ ("move %0,$29" : "=r" (__sp__)); - return __sp__; -} - -#endif /* machine-sp.h */ - diff --git a/sysdeps/mach/mips/syscall.S b/sysdeps/mach/mips/syscall.S deleted file mode 100644 index f2fc29df15..0000000000 --- a/sysdeps/mach/mips/syscall.S +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -#ifdef PIC - .option pic2 -#endif -ENTRY (syscall) - move v0, a0 /* Load system call number from first arg. */ - move a0, a1 /* Move the next three args up a register. */ - move a1, a2 - move a2, a3 - /* Load the remaining possible args (up to 11) from the stack. */ -#ifdef __mips64 - ld t0,4*8(sp) - ld t1,5*8(sp) - ld t2,6*8(sp) - ld t3,7*8(sp) - ld t4,8*8(sp) - ld t5,9*8(sp) - ld t6,10*8(sp) -#else - lw t0,4*4(sp) - lw t1,5*4(sp) - lw t2,6*4(sp) - lw t3,7*4(sp) - lw t4,8*4(sp) - lw t5,9*4(sp) - lw t6,10*4(sp) -#endif - syscall /* Do the system call. */ - j ra /* Return to caller. */ diff --git a/sysdeps/mach/mips/sysdep.h b/sysdeps/mach/mips/sysdep.h deleted file mode 100644 index 8136f95bf2..0000000000 --- a/sysdeps/mach/mips/sysdep.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define LOSE asm volatile ("1: b 1b") - -#define START_MACHDEP asm ("\ - .text\n\ - .globl _start\n\ - .ent _start\n\ -_start:\n\ - # Put initial SP in a0.\n\ - move $4, $29\n\ - # Jump to _start0; don't return.\n\ - j _start0\n\ - .end _start\n\ -"); -#define START_ARGS int *entry_sp -#define SNARF_ARGS(argc, argv, envp) \ - do \ - { \ - register char **p; \ - \ - argc = *entry_sp; \ - argv = (char **) (entry_sp + 1); \ - p = argv; \ - while (*p++ != NULL) \ - ; \ - if (p >= (char **) argv[0]) \ - --p; \ - envp = p; \ - } while (0) - -#define CALL_WITH_SP(fn, sp) \ - ({ register int __fn = fn, __sp = (int) sp; \ - asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));}) - -#define RETURN_TO(sp, pc, retval) \ - asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \ - : : "r" (sp), "r" (pc), "r" (retval)) - -#define STACK_GROWTH_DOWN - -#include <syscall.h> - -#if defined (__ASSEMBLER__) - -#define ALIGN 2 - -#define MOVE(x,y) move y , x - -#define SYSCALL(name, args) \ - .globl syscall_error; \ - kernel_trap(name,SYS_##name,args); \ - beq $1,$0,1f; \ - j syscall_error; \ -1: - -#define SYSCALL__(name, args) \ - .globl syscall_error; \ - kernel_trap(__##name,SYS_##name,args); \ - beq $1,$0,1f; \ - j syscall_error; \ -1: - -#define ret j ra; nop -#endif - -#include <sysdeps/mach/sysdep.h> diff --git a/sysdeps/mach/mips/thread_state.h b/sysdeps/mach/mips/thread_state.h deleted file mode 100644 index a0800de2d0..0000000000 --- a/sysdeps/mach/mips/thread_state.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Mach thread state definitions for machine-independent code. MIPS version. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define MACHINE_THREAD_STATE_FLAVOR MIPS_THREAD_STATE -#define MACHINE_THREAD_STATE_COUNT MIPS_THREAD_STATE_COUNT - -#ifdef __PIC__ -#define MACHINE_THREAD_STATE_SET_PC(ts, pc) \ - ((ts)->PC = (ts)->r25 = (unsigned long int) (pc)) -#endif - -#define machine_thread_state mips_thread_state - -#define PC pc -#define SP r29 -#define SYSRETURN r2 - -struct machine_thread_all_state - { - int set; /* Mask of bits (1 << FLAVOR). */ - struct mips_thread_state basic; - struct mips_exc_state exc; - struct mips_float_state fpu; - }; - -#include <sysdeps/mach/thread_state.h> diff --git a/sysdeps/mips/.cvsignore b/sysdeps/mips/.cvsignore deleted file mode 100644 index 1f69fd919a..0000000000 --- a/sysdeps/mips/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -*.gz *.Z *.tar *.tgz -=* -TODO COPYING* AUTHORS copyr-* copying.* -glibc-* diff --git a/sysdeps/mips/Implies b/sysdeps/mips/Implies deleted file mode 100644 index 8c18cb3034..0000000000 --- a/sysdeps/mips/Implies +++ /dev/null @@ -1,3 +0,0 @@ -# MIPS uses IEEE 754 floating point. -ieee754/flt-32 -ieee754/dbl-64 diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile deleted file mode 100644 index 49ad3e1b91..0000000000 --- a/sysdeps/mips/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -ifeq ($(subdir),misc) -sysdep_headers += regdef.h fpregdef.h sys/regdef.h sys/fpregdef.h \ - sys/asm.h sgidefs.h -endif - -ifeq ($(subdir),setjmp) -sysdep_routines += setjmp_aux -endif - -ifeq ($(subdir),rt) -librt-sysdep_routines += rt-sysdep -endif diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c deleted file mode 100644 index 750a71fd1e..0000000000 --- a/sysdeps/mips/__longjmp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> -#include <stdlib.h> - -#undef __longjmp - -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - -void -__longjmp (env, val_arg) - __jmp_buf env; - int val_arg; -{ - /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before - the hack around it); force it to use $a1 for the longjmp value. - Without this it saves $a1 in a register which gets clobbered - along the way. */ - register int val asm ("a1"); - - /* Pull back the floating point callee-saved registers. */ - asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); - - /* Get and reconstruct the floating point csr. */ - asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); - asm volatile ("ctc1 $2, $31"); - - /* Get the GP. */ - asm volatile ("lw $gp, %0" : : "m" (env[0].__gp)); - - /* Get the callee-saved registers. */ - asm volatile ("lw $16, %0" : : "m" (env[0].__regs[0])); - asm volatile ("lw $17, %0" : : "m" (env[0].__regs[1])); - asm volatile ("lw $18, %0" : : "m" (env[0].__regs[2])); - asm volatile ("lw $19, %0" : : "m" (env[0].__regs[3])); - asm volatile ("lw $20, %0" : : "m" (env[0].__regs[4])); - asm volatile ("lw $21, %0" : : "m" (env[0].__regs[5])); - asm volatile ("lw $22, %0" : : "m" (env[0].__regs[6])); - asm volatile ("lw $23, %0" : : "m" (env[0].__regs[7])); - - /* Get the PC. */ - asm volatile ("lw $25, %0" : : "m" (env[0].__pc)); - - /* Restore the stack pointer and the FP. They have to be restored - last and in a single asm as gcc, depending on options used, may - use either of them to access env. */ - asm volatile ("lw $29, %0\n\t" - "lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); - -/* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ - if (val == 0) - asm volatile ("li $2, 1"); - else - asm volatile ("move $2, %0" : : "r" (val)); - - asm volatile ("jr $25"); - - /* Avoid `volatile function does return' warnings. */ - for (;;); -} diff --git a/sysdeps/mips/abort-instr.h b/sysdeps/mips/abort-instr.h deleted file mode 100644 index d7d8d501b3..0000000000 --- a/sysdeps/mips/abort-instr.h +++ /dev/null @@ -1,2 +0,0 @@ -/* An instruction which should crash any program is a breakpoint. */ -#define ABORT_INSTRUCTION asm ("break 255") diff --git a/sysdeps/mips/add_n.S b/sysdeps/mips/add_n.S deleted file mode 100644 index c82871f701..0000000000 --- a/sysdeps/mips/add_n.S +++ /dev/null @@ -1,122 +0,0 @@ -/* MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and -store sum in a third limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - s2_ptr $6 - size $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_add_n) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - move $2,$0 - - subu $7,$7,$9 - -L(Loop0): addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - addiu $4,$4,4 - -L(L0): beq $7,$0,L(end) - nop - -L(Loop): addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,L(Loop) - addiu $4,$4,16 - -L(end): addu $11,$11,$2 - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - j $31 - or $2,$2,$8 - .end __mpn_add_n diff --git a/sysdeps/mips/addmul_1.S b/sysdeps/mips/addmul_1.S deleted file mode 100644 index 3e1fc09d10..0000000000 --- a/sysdeps/mips/addmul_1.S +++ /dev/null @@ -1,99 +0,0 @@ -/* MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and -add the product to a second limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_addmul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$3,$2 /* carry from previous addition -> $2 */ - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_addmul_1) diff --git a/sysdeps/mips/bits/atomic.h b/sysdeps/mips/bits/atomic.h deleted file mode 100644 index 167d9a59c8..0000000000 --- a/sysdeps/mips/bits/atomic.h +++ /dev/null @@ -1,303 +0,0 @@ -/* Low-level functions for atomic operations. Mips version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MIPS_BITS_ATOMIC_H -#define _MIPS_BITS_ATOMIC_H 1 - -#include <inttypes.h> -#include <sgidefs.h> - -typedef int32_t atomic32_t; -typedef uint32_t uatomic32_t; -typedef int_fast32_t atomic_fast32_t; -typedef uint_fast32_t uatomic_fast32_t; - -typedef int64_t atomic64_t; -typedef uint64_t uatomic64_t; -typedef int_fast64_t atomic_fast64_t; -typedef uint_fast64_t uatomic_fast64_t; - -typedef intptr_t atomicptr_t; -typedef uintptr_t uatomicptr_t; -typedef intmax_t atomic_max_t; -typedef uintmax_t uatomic_max_t; - -#if _MIPS_SIM == _ABIO32 -#define MIPS_PUSH_MIPS2 ".set mips2\n\t" -#else -#define MIPS_PUSH_MIPS2 -#endif - -/* See the comments in <sys/asm.h> about the use of the sync instruction. */ -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#define MIPS_SYNC_STR_2(X) #X -#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X) -#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC) - -/* Compare and exchange. For all of the "xxx" routines, we expect a - "__prev" and a "__cmp" variable to be provided by the enclosing scope, - in which values are returned. */ - -#define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) - -#define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) - -#define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%4\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%2,2f\n\t" \ - "move %1,%3\n\t" \ - "sc %1,%4\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) -#else -#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%4\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%2,2f\n\t" \ - "move %1,%3\n\t" \ - "scd %1,%4\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") -#endif - -/* For all "bool" routines, we return FALSE if exchange succesful. */ - -#define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - !__cmp; }) - -#define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - !__cmp; }) - -/* For all "val" routines, return the old value whether exchange - successful or not. */ - -#define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -#define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -/* Compare and exchange with "acquire" semantics, ie barrier after. */ - -#define atomic_compare_and_exchange_bool_acq(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -#define atomic_compare_and_exchange_val_acq(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -/* Compare and exchange with "release" semantics, ie barrier before. */ - -#define atomic_compare_and_exchange_bool_rel(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, MIPS_SYNC_STR, "") - -#define atomic_compare_and_exchange_val_rel(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, MIPS_SYNC_STR, "") - - - -/* Atomic exchange (without compare). */ - -#define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \ - (abort (), 0) - -#define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \ - (abort (), 0) - -#define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%3\n\t" \ - "move %1,%2\n\t" \ - "sc %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ - (abort (), 0) -#else -#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\n" \ - "lld %0,%3\n\t" \ - "move %1,%2\n\t" \ - "scd %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) -#endif - -#define atomic_exchange_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR) - -#define atomic_exchange_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "") - - -/* Atomically add value and return the previous (unincremented) value. */ - -#define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -#define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -#define __arch_exchange_and_add_32_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%3\n\t" \ - "addu %1,%0,%2\n\t" \ - "sc %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) - -#if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ - (abort (), (typeof(*mem)) 0) -#else -#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%3\n\t" \ - "daddu %1,%0,%2\n\t" \ - "scd %1,%3\n\t" \ - "beqz %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) -#endif - -/* ??? Barrier semantics for atomic_exchange_and_add appear to be - undefined. Use full barrier for now, as that's safe. */ -#define atomic_exchange_and_add(mem, value) \ - __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - MIPS_SYNC_STR, MIPS_SYNC_STR) - -/* TODO: More atomic operations could be implemented efficiently; only the - basic requirements are done. */ - -#define atomic_full_barrier() \ - __asm__ __volatile__ (".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - MIPS_SYNC_STR "\n\t" \ - ".set pop" : : : "memory") - -#endif /* bits/atomic.h */ diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h deleted file mode 100644 index a5b5bf53ff..0000000000 --- a/sysdeps/mips/bits/dlfcn.h +++ /dev/null @@ -1,66 +0,0 @@ -/* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996, 1997, 1999, 2000, 2001, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _DLFCN_H -# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." -#endif - -/* The MODE argument to `dlopen' contains one of the following: */ -#define RTLD_LAZY 0x0001 /* Lazy function call binding. */ -#define RTLD_NOW 0x0002 /* Immediate function call binding. */ -#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ -#define RTLD_NOLOAD 0x00008 /* Do not load the object. */ -#define RTLD_DEEPBIND 0x00010 /* Use deep binding. */ - -/* If the following bit is set in the MODE argument to `dlopen', - the symbols of the loaded object and its dependencies are made - visible as if the object were linked directly into the program. */ -#define RTLD_GLOBAL 0x0004 - -/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. - The implementation does this by default and so we can define the - value to zero. */ -#define RTLD_LOCAL 0 - -/* Do not delete object when closed. */ -#define RTLD_NODELETE 0x01000 - -#ifdef __USE_GNU -/* To support profiling of shared objects it is a good idea to call - the function found using `dlsym' using the following macro since - these calls do not use the PLT. But this would mean the dynamic - loader has no chance to find out when the function is called. The - macro applies the necessary magic so that profiling is possible. - Rewrite - foo = (*fctp) (arg1, arg2); - into - foo = DL_CALL_FCT (fctp, (arg1, arg2)); -*/ -# define DL_CALL_FCT(fctp, args) \ - (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) - -__BEGIN_DECLS - -/* This function calls the profiling functions. */ -extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; - -__END_DECLS - -#endif diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h deleted file mode 100644 index 9586104ccd..0000000000 --- a/sysdeps/mips/bits/endian.h +++ /dev/null @@ -1,13 +0,0 @@ -/* The MIPS architecture has selectable endianness. - This file is for a machine using big-endian mode. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#if __MIPSEB -# define __BYTE_ORDER __BIG_ENDIAN -#endif -#if __MIPSEL -# define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h deleted file mode 100644 index 24e0694ca5..0000000000 --- a/sysdeps/mips/bits/fenv.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FENV_H -# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." -#endif - - -/* Define bits representing the exception. We use the bit positions - of the appropriate bits in the FPU control word. */ -enum - { - FE_INEXACT = 0x04, -#define FE_INEXACT FE_INEXACT - FE_UNDERFLOW = 0x08, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_OVERFLOW = 0x10, -#define FE_OVERFLOW FE_OVERFLOW - FE_DIVBYZERO = 0x20, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_INVALID = 0x40, -#define FE_INVALID FE_INVALID - }; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The MIPS FPU supports all of the four defined rounding modes. We - use again the bit positions in the FPU control word as the values - for the appropriate macros. */ -enum - { - FE_TONEAREST = 0x0, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDZERO = 0x1, -#define FE_TOWARDZERO FE_TOWARDZERO - FE_UPWARD = 0x2, -#define FE_UPWARD FE_UPWARD - FE_DOWNWARD = 0x3 -#define FE_DOWNWARD FE_DOWNWARD - }; - - -/* Type representing exception flags. */ -typedef unsigned short int fexcept_t; - - -/* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ -typedef struct - { - unsigned int __fp_control_register; - } -fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((__const fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((__const fenv_t *) -2) -#endif diff --git a/sysdeps/mips/bits/ipctypes.h b/sysdeps/mips/bits/ipctypes.h deleted file mode 100644 index 0956e7d58c..0000000000 --- a/sysdeps/mips/bits/ipctypes.h +++ /dev/null @@ -1,32 +0,0 @@ -/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* - * Never include <bits/ipctypes.h> directly. - */ - -#ifndef _BITS_IPCTYPES_H -#define _BITS_IPCTYPES_H 1 - -#include <bits/types.h> - -typedef __SLONG32_TYPE __ipc_pid_t; - - -#endif /* bits/ipctypes.h */ diff --git a/sysdeps/mips/bits/link.h b/sysdeps/mips/bits/link.h deleted file mode 100644 index 3d77a4c4a5..0000000000 --- a/sysdeps/mips/bits/link.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LINK_H -# error "Never include <bits/link.h> directly; use <link.h> instead." -#endif - -#include <sgidefs.h> - -#if _MIPS_SIM == _ABIO32 - -/* Registers for entry into PLT on MIPS. */ -typedef struct La_mips_32_regs -{ - uint32_t lr_reg[4]; /* $a0 through $a3 */ - double lr_fpreg[2]; /* $f12 and $f14 */ - uint32_t lr_ra; - uint32_t lr_sp; -} La_mips_32_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_32_retval -{ - uint32_t lrv_v0; - uint32_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_32_retval; - -#else - -typedef struct La_mips_64_regs -{ - uint64_t lr_reg[8]; /* $a0 through $a7 */ - double lr_fpreg[8]; /* $f12 throgh $f19 */ - uint64_t lr_ra; - uint64_t lr_sp; -} La_mips_64_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_64_retval -{ - uint64_t lrv_v0; - uint64_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_64_retval; - -#endif - -__BEGIN_DECLS - -#if _MIPS_SIM == _ABIO32 - -extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_32_regs *__inregs, - La_mips_32_retval *__outregs, - const char *symname); - -#elif _MIPS_SIM == _ABIN32 - -extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *symname); - -#else - -extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *symname); - -#endif - -__END_DECLS diff --git a/sysdeps/mips/bits/mathdef.h b/sysdeps/mips/bits/mathdef.h deleted file mode 100644 index 99be0db2b5..0000000000 --- a/sysdeps/mips/bits/mathdef.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#if !defined _MATH_H && !defined _COMPLEX_H -# error "Never use <bits/mathdef.h> directly; include <math.h> instead" -#endif - -#include <sgidefs.h> - -#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF -# define _MATH_H_MATHDEF 1 - -/* Normally, there is no long double type and the `float' and `double' - expressions are evaluated as `double'. */ -typedef double float_t; /* `float' expressions are evaluated as - `double'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -# define FP_ILOGB0 (-2147483647) -# define FP_ILOGBNAN 2147483647 - -#endif /* ISO C99 */ - -#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/sysdeps/mips/bits/nan.h b/sysdeps/mips/bits/nan.h deleted file mode 100644 index baaaa551fb..0000000000 --- a/sysdeps/mips/bits/nan.h +++ /dev/null @@ -1,56 +0,0 @@ -/* `NAN' constant for IEEE 754 machines. - Copyright (C) 1992, 1996, 1997, 1999, 2002, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MATH_H -# error "Never use <bits/nan.h> directly; include <math.h> instead." -#endif - - -/* IEEE Not A Number (QNaN). Note that MIPS has the QNaN and SNaN patterns - reversed compared to most other architectures. The IEEE spec left - the definition of this open to implementations, and for MIPS the top - bit of the mantissa must be SET to indicate a SNaN. */ - -#if __GNUC_PREREQ(3,3) - -# define NAN (__builtin_nanf("")) - -#elif defined __GNUC__ - -# define NAN \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ - { __l: 0x7fbfffffUL }).__d) - -#else - -# include <endian.h> - -# if __BYTE_ORDER == __BIG_ENDIAN -# define __nan_bytes { 0x7f, 0xbf, 0xff, 0xff } -# endif -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f } -# endif - -static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes }; -# define NAN (__nan_union.__d) - -#endif /* GCC. */ diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h deleted file mode 100644 index 4f159c4988..0000000000 --- a/sysdeps/mips/bits/setjmp.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992,1993,1995,1997,2000,2002,2003,2004,2005,2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MIPS_BITS_SETJMP_H -#define _MIPS_BITS_SETJMP_H 1 - -#if !defined(_SETJMP_H) && !defined(_PTHREAD_H) -# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." -#endif - -#include <sgidefs.h> - -typedef struct - { -#if _MIPS_SIM == _ABIO32 - /* Program counter. */ - __ptr_t __pc; - - /* Stack pointer. */ - __ptr_t __sp; - - /* Callee-saved registers s0 through s7. */ - int __regs[8]; - - /* The frame pointer. */ - __ptr_t __fp; - - /* The global pointer. */ - __ptr_t __gp; -#else - /* Program counter. */ - __extension__ long long __pc; - - /* Stack pointer. */ - __extension__ long long __sp; - - /* Callee-saved registers s0 through s7. */ - __extension__ long long __regs[8]; - - /* The frame pointer. */ - __extension__ long long __fp; - - /* The global pointer. */ - __extension__ long long __gp; -#endif - - /* Floating point status register. */ - int __fpc_csr; - - /* Callee-saved floating point registers. */ -#if _MIPS_SIM == _ABI64 - double __fpregs[8]; -#else - double __fpregs[6]; -#endif - } __jmp_buf[1]; - -#endif /* _MIPS_BITS_SETJMP_H */ diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h deleted file mode 100644 index 666c7ad07e..0000000000 --- a/sysdeps/mips/bits/wordsize.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define __WORDSIZE _MIPS_SZPTR diff --git a/sysdeps/mips/bsd-_setjmp.S b/sysdeps/mips/bsd-_setjmp.S deleted file mode 100644 index 5e3ad50305..0000000000 --- a/sysdeps/mips/bsd-_setjmp.S +++ /dev/null @@ -1,43 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS version. - Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 0)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sysdep.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (_setjmp) -#ifdef __PIC__ - .set noreorder - .cpload t9 - .set reorder - la t9, C_SYMBOL_NAME (__sigsetjmp) -#endif - move a1,zero /* Pass a second argument of zero. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end _setjmp -libc_hidden_def (_setjmp) diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S deleted file mode 100644 index 0aea011328..0000000000 --- a/sysdeps/mips/bsd-setjmp.S +++ /dev/null @@ -1,42 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sysdep.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (setjmp) - .set noreorder -#ifdef __PIC__ - .cpload t9 - .set reorder - la t9, C_SYMBOL_NAME (__sigsetjmp) -#endif - li a1, 1 /* Pass a second argument of one. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end setjmp diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h deleted file mode 100644 index dfd03ba317..0000000000 --- a/sysdeps/mips/dl-dtprocnum.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Configuration of lookup functions. MIPS version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Number of extra dynamic section entries for this architecture. By - default there are none. */ -#define DT_THISPROCNUM DT_MIPS_NUM diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h deleted file mode 100644 index c04609f9bc..0000000000 --- a/sysdeps/mips/dl-machine.h +++ /dev/null @@ -1,611 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. MIPS version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* FIXME: Profiling of shared libraries is not implemented yet. */ -#ifndef dl_machine_h -#define dl_machine_h - -#define ELF_MACHINE_NAME "MIPS" - -#define ELF_MACHINE_NO_PLT - -#include <entry.h> - -#ifndef ENTRY_POINT -#error ENTRY_POINT needs to be defined for MIPS. -#endif - -#include <sgidefs.h> -#include <sys/asm.h> -#include <dl-tls.h> - -/* The offset of gp from GOT might be system-dependent. It's set by - ld. The same value is also */ -#define OFFSET_GP_GOT 0x7ff0 - -#ifndef _RTLD_PROLOGUE -# define _RTLD_PROLOGUE(entry) \ - ".globl\t" __STRING(entry) "\n\t" \ - ".ent\t" __STRING(entry) "\n\t" \ - ".type\t" __STRING(entry) ", @function\n" \ - __STRING(entry) ":\n\t" -#endif - -#ifndef _RTLD_EPILOGUE -# define _RTLD_EPILOGUE(entry) \ - ".end\t" __STRING(entry) "\n\t" \ - ".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t" -#endif - -/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. - This makes no sense on MIPS but we have to define this to R_MIPS_REL32 - to avoid the asserts in dl-lookup.c from blowing. */ -#define ELF_MACHINE_JMP_SLOT R_MIPS_REL32 -#define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT - -/* Translate a processor specific dynamic tag to the index - in l_info array. */ -#define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM) - -/* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in - with the run-time address of the r_debug structure */ -#define ELF_MACHINE_DEBUG_SETUP(l,r) \ -do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ - *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ - (ElfW(Addr)) (r); \ - } while (0) - -/* Return nonzero iff ELF header is compatible with the running host. */ -static inline int __attribute_used__ -elf_machine_matches_host (const ElfW(Ehdr) *ehdr) -{ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 - /* Don't link o32 and n32 together. */ - if (((ehdr->e_flags & EF_MIPS_ABI2) != 0) != (_MIPS_SIM == _ABIN32)) - return 0; -#endif - - switch (ehdr->e_machine) - { - case EM_MIPS: - case EM_MIPS_RS3_LE: - return 1; - default: - return 0; - } -} - -static inline ElfW(Addr) * -elf_mips_got_from_gpreg (ElfW(Addr) gpreg) -{ - /* FIXME: the offset of gp from GOT may be system-dependent. */ - return (ElfW(Addr) *) (gpreg - OFFSET_GP_GOT); -} - -/* Return the link-time address of _DYNAMIC. Conveniently, this is the - first element of the GOT. This must be inlined in a function which - uses global data. We assume its $gp points to the primary GOT. */ -static inline ElfW(Addr) -elf_machine_dynamic (void) -{ - register ElfW(Addr) gp __asm__ ("$28"); - return *elf_mips_got_from_gpreg (gp); -} - -#define STRINGXP(X) __STRING(X) -#define STRINGXV(X) STRINGV_(X) -#define STRINGV_(...) # __VA_ARGS__ - -/* Return the run-time load address of the shared object. */ -static inline ElfW(Addr) -elf_machine_load_address (void) -{ - ElfW(Addr) addr; - asm (" .set noreorder\n" - " " STRINGXP (PTR_LA) " %0, 0f\n" - " bltzal $0, 0f\n" - " nop\n" - "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n" - " .set reorder\n" - : "=r" (addr) - : /* No inputs */ - : "$31"); - return addr; -} - -/* The MSB of got[1] of a gnu object is set to identify gnu objects. */ -#if _MIPS_SIM == _ABI64 -# define ELF_MIPS_GNU_GOT1_MASK 0x8000000000000000L -#else -# define ELF_MIPS_GNU_GOT1_MASK 0x80000000L -#endif - -/* We can't rely on elf_machine_got_rel because _dl_object_relocation_scope - fiddles with global data. */ -#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \ -do { \ - struct link_map *map = &bootstrap_map; \ - ElfW(Sym) *sym; \ - ElfW(Addr) *got; \ - int i, n; \ - \ - got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); \ - \ - if (__builtin_expect (map->l_addr == 0, 1)) \ - break; \ - \ - /* got[0] is reserved. got[1] is also reserved for the dynamic object \ - generated by gnu ld. Skip these reserved entries from \ - relocation. */ \ - i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1; \ - n = map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \ - \ - /* Add the run-time displacement to all local got entries. */ \ - while (i < n) \ - got[i++] += map->l_addr; \ - \ - /* Handle global got entries. */ \ - got += n; \ - sym = (ElfW(Sym) *) D_PTR(map, l_info[DT_SYMTAB]) \ - + map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; \ - i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val \ - - map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val); \ - \ - while (i--) \ - { \ - if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_COMMON) \ - *got = map->l_addr + sym->st_value; \ - else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC \ - && *got != sym->st_value) \ - *got += map->l_addr; \ - else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION) \ - { \ - if (sym->st_other == 0) \ - *got += map->l_addr; \ - } \ - else \ - *got = map->l_addr + sym->st_value; \ - \ - got++; \ - sym++; \ - } \ -} while(0) - - -/* Mask identifying addresses reserved for the user program, - where the dynamic linker should not map anything. */ -#define ELF_MACHINE_USER_ADDRESS_MASK 0x80000000UL - - -/* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. - Note how we have to be careful about two things: - - 1) That we allocate a minimal stack of 24 bytes for - every function call, the MIPS ABI states that even - if all arguments are passed in registers the procedure - called can use the 16 byte area pointed to by $sp - when it is called to store away the arguments passed - to it. - - 2) That under Linux the entry is named __start - and not just plain _start. */ - -#define RTLD_START asm (\ - ".text\n\ - " _RTLD_PROLOGUE(ENTRY_POINT) "\ - " STRINGXV(SETUP_GPX($25)) "\n\ - " STRINGXV(SETUP_GPX64($18,$25)) "\n\ - # i386 ABI book says that the first entry of GOT holds\n\ - # the address of the dynamic structure. Though MIPS ABI\n\ - # doesn't say nothing about this, I emulate this here.\n\ - " STRINGXP(PTR_LA) " $4, _DYNAMIC\n\ - # Subtract OFFSET_GP_GOT\n\ - " STRINGXP(PTR_S) " $4, -0x7ff0($28)\n\ - move $4, $29\n\ - " STRINGXP(PTR_SUBIU) " $29, 16\n\ - \n\ - " STRINGXP(PTR_LA) " $8, .Lcoff\n\ - bltzal $8, .Lcoff\n\ -.Lcoff: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\ - \n\ - " STRINGXP(PTR_LA) " $25, _dl_start\n\ - " STRINGXP(PTR_ADDU) " $25, $8\n\ - jalr $25\n\ - \n\ - " STRINGXP(PTR_ADDIU) " $29, 16\n\ - # Get the value of label '_dl_start_user' in t9 ($25).\n\ - " STRINGXP(PTR_LA) " $25, _dl_start_user\n\ - " _RTLD_EPILOGUE(ENTRY_POINT) "\ - \n\ - \n\ - " _RTLD_PROLOGUE(_dl_start_user) "\ - " STRINGXP(SETUP_GP) "\n\ - " STRINGXV(SETUP_GP64($18,_dl_start_user)) "\n\ - move $16, $28\n\ - # Save the user entry point address in a saved register.\n\ - move $17, $2\n\ - # See if we were run as a command with the executable file\n\ - # name as an extra leading argument.\n\ - lw $2, _dl_skip_args\n\ - beq $2, $0, 1f\n\ - # Load the original argument count.\n\ - " STRINGXP(PTR_L) " $4, 0($29)\n\ - # Subtract _dl_skip_args from it.\n\ - subu $4, $2\n\ - # Adjust the stack pointer to skip _dl_skip_args words.\n\ - sll $2, " STRINGXP (PTRLOG) "\n\ - " STRINGXP(PTR_ADDU) " $29, $2\n\ - # Save back the modified argument count.\n\ - " STRINGXP(PTR_S) " $4, 0($29)\n\ -1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\ - " STRINGXP(PTR_L) " $4, _rtld_local\n\ - " STRINGXP(PTR_L) /* or lw??? fixme */ " $5, 0($29)\n\ - " STRINGXP(PTR_LA) " $6, " STRINGXP (PTRSIZE) "($29)\n\ - sll $7, $5, " STRINGXP (PTRLOG) "\n\ - " STRINGXP(PTR_ADDU) " $7, $7, $6\n\ - " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\ - # Make sure the stack pointer is aligned for _dl_init_internal.\n\ - and $2, $29, -2 * " STRINGXP(SZREG) "\n\ - " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\ - " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\ - " STRINGXP(SAVE_GP(16)) "\n\ - # Call the function to run the initializers.\n\ - jal _dl_init_internal\n\ - # Restore the stack pointer for _start.\n\ - " STRINGXP(PTR_L) " $29, 32-" STRINGXP(SZREG) "($29)\n\ - # Pass our finalizer function to the user in $2 as per ELF ABI.\n\ - " STRINGXP(PTR_LA) " $2, _dl_fini\n\ - # Jump to the user entry point.\n\ - move $25, $17\n\ - jr $25\n\t"\ - _RTLD_EPILOGUE(_dl_start_user)\ - ".previous"\ -); - -/* The MIPS never uses Elfxx_Rela relocations. */ -#define ELF_MACHINE_NO_RELA 1 - -/* Names of the architecture-specific auditing callback functions. */ -# if _MIPS_SIM == _ABIO32 -# define ARCH_LA_PLTENTER mips_o32_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_o32_gnu_pltexit -# elif _MIPS_SIM == _ABIN32 -# define ARCH_LA_PLTENTER mips_n32_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_n32_gnu_pltexit -# else -# define ARCH_LA_PLTENTER mips_n64_gnu_pltenter -# define ARCH_LA_PLTEXIT mips_n64_gnu_pltexit -# endif - -#endif /* !dl_machine_h */ - -#ifdef RESOLVE_MAP - -/* Perform the relocation specified by RELOC and SYM (which is fully resolved). - MAP is the object containing the reloc. */ - -auto inline void -__attribute__ ((always_inline)) -elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, - const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) -{ - const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info); - -#if !defined RTLD_BOOTSTRAP && !defined SHARED - /* This is defined in rtld.c, but nowhere in the static libc.a; - make the reference weak so static programs can still link. This - declaration cannot be done when compiling rtld.c (i.e. #ifdef - RTLD_BOOTSTRAP) because rtld.c contains the common defn for - _dl_rtld_map, which is incompatible with a weak decl in the same - file. */ - weak_extern (GL(dl_rtld_map)); -#endif - - switch (r_type) - { -#if defined (USE_TLS) && !defined (RTLD_BOOTSTRAP) -# if _MIPS_SIM == _ABI64 - case R_MIPS_TLS_DTPMOD64: - case R_MIPS_TLS_DTPREL64: - case R_MIPS_TLS_TPREL64: -# else - case R_MIPS_TLS_DTPMOD32: - case R_MIPS_TLS_DTPREL32: - case R_MIPS_TLS_TPREL32: -# endif - { - struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); - Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; - - if (sym) - value += sym->st_value; - - switch (r_type) - { - case R_MIPS_TLS_DTPMOD64: - case R_MIPS_TLS_DTPMOD32: - if (sym_map) - *(ElfW(Word) *)reloc_addr = sym_map->l_tls_modid; - break; - - case R_MIPS_TLS_DTPREL64: - case R_MIPS_TLS_DTPREL32: - *(ElfW(Word) *)reloc_addr += TLS_DTPREL_VALUE (sym); - break; - - case R_MIPS_TLS_TPREL32: - case R_MIPS_TLS_TPREL64: - CHECK_STATIC_TLS (map, sym_map); - *(ElfW(Word) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym); - break; - } - - break; - } -#endif - -#if _MIPS_SIM == _ABI64 - case (R_MIPS_64 << 8) | R_MIPS_REL32: -#else - case R_MIPS_REL32: -#endif - { - int symidx = ELFW(R_SYM) (reloc->r_info); - ElfW(Addr) reloc_value; - - /* Support relocations on mis-aligned offsets. Should we ever - implement RELA, this should be replaced with an assignment - from reloc->r_addend. */ - __builtin_memcpy (&reloc_value, reloc_addr, sizeof (reloc_value)); - - if (symidx) - { - const ElfW(Word) gotsym - = (const ElfW(Word)) map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - - if ((ElfW(Word))symidx < gotsym) - { - /* This wouldn't work for a symbol imported from other - libraries for which there's no GOT entry, but MIPS - requires every symbol referenced in a dynamic - relocation to have a GOT entry in the primary GOT, - so we only get here for locally-defined symbols. - For section symbols, we should *NOT* be adding - sym->st_value (per the definition of the meaning of - S in reloc expressions in the ELF64 MIPS ABI), - since it should have already been added to - reloc_value by the linker, but older versions of - GNU ld didn't add it, and newer versions don't emit - useless relocations to section symbols any more, so - it is safe to keep on adding sym->st_value, even - though it's not ABI compliant. Some day we should - bite the bullet and stop doing this. */ -#ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) -#endif - reloc_value += sym->st_value + map->l_addr; - } - else - { -#ifndef RTLD_BOOTSTRAP - const ElfW(Addr) *got - = (const ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); - const ElfW(Word) local_gotno - = (const ElfW(Word)) - map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - - reloc_value += got[symidx + local_gotno - gotsym]; -#endif - } - } - else -#ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) -#endif - reloc_value += map->l_addr; - - __builtin_memcpy (reloc_addr, &reloc_value, sizeof (reloc_value)); - } - break; - case R_MIPS_NONE: /* Alright, Wilbur. */ - break; -#if _MIPS_SIM == _ABI64 - case R_MIPS_64: - /* For full compliance with the ELF64 ABI, one must precede the - _REL32/_64 pair of relocations with a _64 relocation, such - that the in-place addend is read as a 64-bit value. IRIX - didn't pick up on this requirement, so we treat the - _REL32/_64 relocation as a 64-bit relocation even if it's by - itself. For ABI compliance, we ignore such _64 dummy - relocations. For RELA, this may be simply removed, since - it's totally unnecessary. */ - if (ELFW(R_SYM) (reloc->r_info) == 0) - break; - /* Fall through. */ -#endif - default: - _dl_reloc_bad_type (map, r_type, 0); - break; - } -} - -auto inline void -__attribute__((always_inline)) -elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, - void *const reloc_addr) -{ - /* XXX Nothing to do. There is no relative relocation, right? */ -} - -auto inline void -__attribute__((always_inline)) -elf_machine_lazy_rel (struct link_map *map, - ElfW(Addr) l_addr, const ElfW(Rel) *reloc) -{ - /* Do nothing. */ -} - -auto inline void -__attribute__ ((always_inline)) -elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, - const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) -{ -} - -auto inline void -__attribute__((always_inline)) -elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, - void *const reloc_addr) -{ -} - -#ifndef RTLD_BOOTSTRAP -/* Relocate GOT. */ -auto inline void -__attribute__((always_inline)) -elf_machine_got_rel (struct link_map *map, int lazy) -{ - ElfW(Addr) *got; - ElfW(Sym) *sym; - const ElfW(Half) *vernum; - int i, n, symidx; - -#define RESOLVE_GOTSYM(sym,vernum,sym_index) \ - ({ \ - const ElfW(Sym) *ref = sym; \ - const struct r_found_version *version \ - = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \ - struct link_map *sym_map; \ - sym_map = RESOLVE_MAP (&ref, version, R_MIPS_REL32); \ - ref ? sym_map->l_addr + ref->st_value : 0; \ - }) - - if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL) - vernum = (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); - else - vernum = NULL; - - got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]); - - n = map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - /* The dynamic linker's local got entries have already been relocated. */ - if (map != &GL(dl_rtld_map)) - { - /* got[0] is reserved. got[1] is also reserved for the dynamic object - generated by gnu ld. Skip these reserved entries from relocation. */ - i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1; - - /* Add the run-time displacement to all local got entries if - needed. */ - if (__builtin_expect (map->l_addr != 0, 0)) - { - while (i < n) - got[i++] += map->l_addr; - } - } - - /* Handle global got entries. */ - got += n; - /* Keep track of the symbol index. */ - symidx = map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - sym = (ElfW(Sym) *) D_PTR (map, l_info[DT_SYMTAB]) + symidx; - i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val - - map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val); - - /* This loop doesn't handle Quickstart. */ - while (i--) - { - if (sym->st_shndx == SHN_UNDEF) - { - if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC - && sym->st_value && lazy) - *got = sym->st_value + map->l_addr; - else - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - } - else if (sym->st_shndx == SHN_COMMON) - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC - && *got != sym->st_value - && lazy) - *got += map->l_addr; - else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION) - { - if (sym->st_other == 0) - *got += map->l_addr; - } - else - *got = RESOLVE_GOTSYM (sym, vernum, symidx); - - ++got; - ++sym; - ++symidx; - } - -#undef RESOLVE_GOTSYM -} -#endif - -/* Set up the loaded object described by L so its stub function - will jump to the on-demand fixup code __dl_runtime_resolve. */ - -auto inline int -__attribute__((always_inline)) -elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) -{ -# ifndef RTLD_BOOTSTRAP - ElfW(Addr) *got; - extern void _dl_runtime_resolve (ElfW(Word)); - extern int _dl_mips_gnu_objects; - - if (lazy) - { - /* The GOT entries for functions have not yet been filled in. - Their initial contents will arrange when called to put an - offset into the .dynsym section in t8, the return address - in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */ - got = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); - - /* This function will get called to fix up the GOT entry indicated by - the register t8, and then jump to the resolved address. */ - got[0] = (ElfW(Addr)) &_dl_runtime_resolve; - - /* Store l to _GLOBAL_OFFSET_TABLE[1] for gnu object. The MSB - of got[1] of a gnu object is set to identify gnu objects. - Where we can store l for non gnu objects? XXX */ - if ((got[1] & ELF_MIPS_GNU_GOT1_MASK) != 0) - got[1] = ((ElfW(Addr)) l | ELF_MIPS_GNU_GOT1_MASK); - else - _dl_mips_gnu_objects = 0; - } - - /* Relocate global offset table. */ - elf_machine_got_rel (l, lazy); - -# endif - return lazy; -} - -#endif /* RESOLVE_MAP */ diff --git a/sysdeps/mips/dl-tls.h b/sysdeps/mips/dl-tls.h deleted file mode 100644 index 6d3ed6f5a4..0000000000 --- a/sysdeps/mips/dl-tls.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -/* Type used for the representation of TLS information in the GOT. */ -typedef struct -{ - unsigned long int ti_module; - unsigned long int ti_offset; -} tls_index; - -/* The thread pointer points 0x7000 past the first static TLS block. */ -#define TLS_TP_OFFSET 0x7000 - -/* Dynamic thread vector pointers point 0x8000 past the start of each - TLS block. */ -#define TLS_DTV_OFFSET 0x8000 - -/* Compute the value for a GOTTPREL reloc. */ -#define TLS_TPREL_VALUE(sym_map, sym) \ - ((sym_map)->l_tls_offset + (sym)->st_value - TLS_TP_OFFSET) - -/* Compute the value for a DTPREL reloc. */ -#define TLS_DTPREL_VALUE(sym) \ - ((sym)->st_value - TLS_DTV_OFFSET) - -extern void *__tls_get_addr (tls_index *ti); - -# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET) -# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET) diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c deleted file mode 100644 index 459adf9a8e..0000000000 --- a/sysdeps/mips/dl-trampoline.c +++ /dev/null @@ -1,272 +0,0 @@ -/* PLT trampoline. MIPS version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* FIXME: Profiling of shared libraries is not implemented yet. */ - -#include <sysdep.h> -#include <link.h> -#include <elf.h> -#include <ldsodefs.h> -#include <dl-machine.h> - -/* Get link map for callers object containing STUB_PC. */ -static inline struct link_map * -elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) -{ - extern int _dl_mips_gnu_objects; - - /* got[1] is reserved to keep its link map address for the shared - object generated by the gnu linker. If all are such objects, we - can find the link map from current GPREG simply. If not so, get - the link map for caller's object containing STUB_PC. */ - - if (_dl_mips_gnu_objects) - { - ElfW(Addr) *got = elf_mips_got_from_gpreg (gpreg); - ElfW(Word) g1; - - g1 = ((ElfW(Word) *) got)[1]; - - if ((g1 & ELF_MIPS_GNU_GOT1_MASK) != 0) - { - struct link_map *l = - (struct link_map *) (g1 & ~ELF_MIPS_GNU_GOT1_MASK); - ElfW(Addr) base, limit; - const ElfW(Phdr) *p = l->l_phdr; - ElfW(Half) this, nent = l->l_phnum; - - /* For the common case of a stub being called from the containing - object, STUB_PC will point to somewhere within the object that - is described by the link map fetched via got[1]. Otherwise we - have to scan all maps. */ - for (this = 0; this < nent; this++) - { - if (p[this].p_type == PT_LOAD) - { - base = p[this].p_vaddr + l->l_addr; - limit = base + p[this].p_memsz; - if (stub_pc >= base && stub_pc < limit) - return l; - } - } - } - } - - struct link_map *l; - Lmid_t nsid; - - for (nsid = 0; nsid < DL_NNS; ++nsid) - for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next) - { - ElfW(Addr) base, limit; - const ElfW(Phdr) *p = l->l_phdr; - ElfW(Half) this, nent = l->l_phnum; - - for (this = 0; this < nent; ++this) - { - if (p[this].p_type == PT_LOAD) - { - base = p[this].p_vaddr + l->l_addr; - limit = base + p[this].p_memsz; - if (stub_pc >= base && stub_pc < limit) - return l; - } - } - } - - _dl_signal_error (0, NULL, NULL, "cannot find runtime link map"); - return NULL; -} - -/* Define mips specific runtime resolver. The function __dl_runtime_resolve - is called from assembler function _dl_runtime_resolve which converts - special argument registers t7 ($15) and t8 ($24): - t7 address to return to the caller of the function - t8 index for this function symbol in .dynsym - to usual c arguments. - - Other architectures call fixup from dl-runtime.c in - _dl_runtime_resolve. MIPS instead calls __dl_runtime_resolve. We - have to use our own version because of the way the got section is - treated on MIPS (we've also got ELF_MACHINE_PLT defined). */ - -/* The flag _dl_mips_gnu_objects is set if all dynamic objects are - generated by the gnu linker. */ -int _dl_mips_gnu_objects = 1; - -#define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) - -/* This is called from assembly stubs below which the compiler can't see. */ -static ElfW(Addr) -__dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr)) - __attribute_used__; - -static ElfW(Addr) -__dl_runtime_resolve (ElfW(Word) sym_index, - ElfW(Word) return_address, - ElfW(Addr) old_gpreg, - ElfW(Addr) stub_pc) -{ - struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); - const ElfW(Sym) *const symtab - = (const ElfW(Sym) *) D_PTR (l, l_info[DT_SYMTAB]); - const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); - ElfW(Addr) *got - = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); - const ElfW(Word) local_gotno - = (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; - const ElfW(Word) gotsym - = (const ElfW(Word)) l->l_info[DT_MIPS (GOTSYM)]->d_un.d_val; - const ElfW(Sym) *sym = &symtab[sym_index]; - struct link_map *sym_map; - ElfW(Addr) value; - - /* FIXME: The symbol versioning stuff is not tested yet. */ - if (__builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0) - { - switch (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL) - { - default: - { - const ElfW(Half) *vernum = - (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]); - ElfW(Half) ndx = vernum[sym_index] & 0x7fff; - const struct r_found_version *version = &l->l_versions[ndx]; - - if (version->hash != 0) - { - sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, - &sym, l->l_scope, version, - ELF_RTYPE_CLASS_PLT, 0, 0); - break; - } - /* Fall through. */ - } - case 0: - sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym, - l->l_scope, 0, ELF_RTYPE_CLASS_PLT, - DL_LOOKUP_ADD_DEPENDENCY, 0); - } - - /* Currently value contains the base load address of the object - that defines sym. Now add in the symbol offset. */ - value = (sym ? sym_map->l_addr + sym->st_value : 0); - } - else - /* We already found the symbol. The module (and therefore its load - address) is also known. */ - value = l->l_addr + sym->st_value; - - /* Apply the relocation with that value. */ - *(got + local_gotno + sym_index - gotsym) = value; - - return value; -} - -#if _MIPS_SIM == _ABIO32 -#define ELF_DL_FRAME_SIZE 40 - -#define ELF_DL_SAVE_ARG_REGS "\ - sw $15, 36($29)\n \ - sw $4, 16($29)\n \ - sw $5, 20($29)\n \ - sw $6, 24($29)\n \ - sw $7, 28($29)\n \ -" - -#define ELF_DL_RESTORE_ARG_REGS "\ - lw $31, 36($29)\n \ - lw $4, 16($29)\n \ - lw $5, 20($29)\n \ - lw $6, 24($29)\n \ - lw $7, 28($29)\n \ -" - -#define IFABIO32(X) X - -#else /* _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 */ - -#define ELF_DL_FRAME_SIZE 80 - -#define ELF_DL_SAVE_ARG_REGS "\ - sd $15, 72($29)\n \ - sd $4, 8($29)\n \ - sd $5, 16($29)\n \ - sd $6, 24($29)\n \ - sd $7, 32($29)\n \ - sd $8, 40($29)\n \ - sd $9, 48($29)\n \ - sd $10, 56($29)\n \ - sd $11, 64($29)\n \ -" - -#define ELF_DL_RESTORE_ARG_REGS "\ - ld $31, 72($29)\n \ - ld $4, 8($29)\n \ - ld $5, 16($29)\n \ - ld $6, 24($29)\n \ - ld $7, 32($29)\n \ - ld $8, 40($29)\n \ - ld $9, 48($29)\n \ - ld $10, 56($29)\n \ - ld $11, 64($29)\n \ -" - -#define IFABIO32(X) - -#endif - -asm ("\n\ - .text\n\ - .align 2\n\ - .globl _dl_runtime_resolve\n\ - .type _dl_runtime_resolve,@function\n\ - .ent _dl_runtime_resolve\n\ -_dl_runtime_resolve:\n\ - .frame $29, " STRINGXP(ELF_DL_FRAME_SIZE) ", $31\n\ - .set noreorder\n\ - # Save GP.\n\ - move $3, $28\n\ - # Save arguments and sp value in stack.\n\ - " STRINGXP(PTR_SUBIU) " $29, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\ - # Modify t9 ($25) so as to point .cpload instruction.\n\ - " IFABIO32(STRINGXP(PTR_ADDIU) " $25, 12\n") "\ - # Compute GP.\n\ - " STRINGXP(SETUP_GP) "\n\ - " STRINGXV(SETUP_GP64 (0, _dl_runtime_resolve)) "\n\ - .set reorder\n\ - # Save slot call pc.\n\ - move $2, $31\n\ - " IFABIO32(STRINGXP(CPRESTORE(32))) "\n\ - " ELF_DL_SAVE_ARG_REGS "\ - move $4, $24\n\ - move $5, $15\n\ - move $6, $3\n\ - move $7, $2\n\ - jal __dl_runtime_resolve\n\ - " ELF_DL_RESTORE_ARG_REGS "\ - " STRINGXP(RESTORE_GP64) "\n\ - " STRINGXP(PTR_ADDIU) " $29, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\ - move $25, $2\n\ - jr $25\n\ - .end _dl_runtime_resolve\n\ - .previous\n\ -"); diff --git a/sysdeps/mips/elf/configure b/sysdeps/mips/elf/configure deleted file mode 100644 index 3d90a1e420..0000000000 --- a/sysdeps/mips/elf/configure +++ /dev/null @@ -1,46 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/mips/elf. - -if test "$usetls" != no; then -# Check for support of thread-local storage handling in assembler and -# linker. -echo "$as_me:$LINENO: checking for MIPS TLS support" >&5 -echo $ECHO_N "checking for MIPS TLS support... $ECHO_C" >&6 -if test "${libc_cv_mips_tls+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <<\EOF - .section ".tdata", "awT", %progbits - .globl foo -foo: .long 1 - .section ".tbss", "awT", %nobits - .globl bar -bar: .skip 4 - .text - - lw $25, %call16(__tls_get_addr)($28) - jalr $25 - addiu $4, $28, %tlsgd(x) -EOF -if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_mips_tls=yes -else - libc_cv_mips_tls=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $libc_cv_mips_tls" >&5 -echo "${ECHO_T}$libc_cv_mips_tls" >&6 -if test $libc_cv_mips_tls = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_TLS_SUPPORT 1 -_ACEOF - -fi -fi - diff --git a/sysdeps/mips/elf/configure.in b/sysdeps/mips/elf/configure.in deleted file mode 100644 index ecb9108c12..0000000000 --- a/sysdeps/mips/elf/configure.in +++ /dev/null @@ -1,35 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/mips/elf. - -if test "$usetls" != no; then -# Check for support of thread-local storage handling in assembler and -# linker. -AC_CACHE_CHECK(for MIPS TLS support, libc_cv_mips_tls, [dnl -cat > conftest.s <<\EOF - .section ".tdata", "awT", %progbits - .globl foo -foo: .long 1 - .section ".tbss", "awT", %nobits - .globl bar -bar: .skip 4 - .text - - lw $25, %call16(__tls_get_addr)($28) - jalr $25 - addiu $4, $28, %tlsgd(x) -EOF -dnl -if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_mips_tls=yes -else - libc_cv_mips_tls=no -fi -rm -f conftest*]) -if test $libc_cv_mips_tls = yes; then - AC_DEFINE(HAVE_TLS_SUPPORT) -fi -fi - -dnl No MIPS GCC supports accessing static and hidden symbols in an -dnl position independent way. -dnl AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/sysdeps/mips/elf/ldsodefs.h b/sysdeps/mips/elf/ldsodefs.h deleted file mode 100644 index 3868b50ff6..0000000000 --- a/sysdeps/mips/elf/ldsodefs.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MIPS_LDSODEFS_H -#define _MIPS_LDSODEFS_H - -/* The MIPS ABI specifies that the dynamic section has to be read-only. */ - -#define DL_RO_DYN_SECTION 1 - -#include_next <ldsodefs.h> - -/* The 64-bit MIPS ELF ABI uses an unusual reloc format. Each - relocation entry specifies up to three actual relocations, all at - the same address. The first relocation which required a symbol - uses the symbol in the r_sym field. The second relocation which - requires a symbol uses the symbol in the r_ssym field. If all - three relocations require a symbol, the third one uses a zero - value. - - We define these structures in internal headers because we're not - sure we want to make them part of the ABI yet. Eventually, some of - this may move into elf/elf.h. */ - -/* An entry in a 64 bit SHT_REL section. */ - -typedef struct -{ - Elf32_Word r_sym; /* Symbol index */ - unsigned char r_ssym; /* Special symbol for 2nd relocation */ - unsigned char r_type3; /* 3rd relocation type */ - unsigned char r_type2; /* 2nd relocation type */ - unsigned char r_type1; /* 1st relocation type */ -} _Elf64_Mips_R_Info; - -typedef union -{ - Elf64_Xword r_info_number; - _Elf64_Mips_R_Info r_info_fields; -} _Elf64_Mips_R_Info_union; - -typedef struct -{ - Elf64_Addr r_offset; /* Address */ - _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ -} Elf64_Mips_Rel; - -typedef struct -{ - Elf64_Addr r_offset; /* Address */ - _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ - Elf64_Sxword r_addend; /* Addend */ -} Elf64_Mips_Rela; - -#define ELF64_MIPS_R_SYM(i) \ - ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) -#define ELF64_MIPS_R_TYPE(i) \ - (((_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1 \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_type2 << 8) \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_type3 << 16) \ - | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ - ).r_info_fields.r_ssym << 24)) -#define ELF64_MIPS_R_INFO(sym, type) \ - (__extension__ (_Elf64_Mips_R_Info_union) \ - (__extension__ (_Elf64_Mips_R_Info) \ - { (sym), ELF64_MIPS_R_SSYM (type), \ - ELF64_MIPS_R_TYPE3 (type), \ - ELF64_MIPS_R_TYPE2 (type), \ - ELF64_MIPS_R_TYPE1 (type) \ - }).r_info_number) -/* These macros decompose the value returned by ELF64_MIPS_R_TYPE, and - compose it back into a value that it can be used as an argument to - ELF64_MIPS_R_INFO. */ -#define ELF64_MIPS_R_SSYM(i) (((i) >> 24) & 0xff) -#define ELF64_MIPS_R_TYPE3(i) (((i) >> 16) & 0xff) -#define ELF64_MIPS_R_TYPE2(i) (((i) >> 8) & 0xff) -#define ELF64_MIPS_R_TYPE1(i) ((i) & 0xff) -#define ELF64_MIPS_R_TYPEENC(type1, type2, type3, ssym) \ - ((type1) \ - | ((Elf32_Word)(type2) << 8) \ - | ((Elf32_Word)(type3) << 16) \ - | ((Elf32_Word)(ssym) << 24)) - -#undef ELF64_R_SYM -#define ELF64_R_SYM(i) ELF64_MIPS_R_SYM (i) -#undef ELF64_R_TYPE -#define ELF64_R_TYPE(i) ELF64_MIPS_R_TYPE (i) -#undef ELF64_R_INFO -#define ELF64_R_INFO(sym, type) ELF64_MIPS_R_INFO ((sym), (type)) - -#endif diff --git a/sysdeps/mips/elf/start.S b/sysdeps/mips/elf/start.S deleted file mode 100644 index d9cc3b7ee2..0000000000 --- a/sysdeps/mips/elf/start.S +++ /dev/null @@ -1,119 +0,0 @@ -/* Startup code compliant to the ELF Mips ABI. - Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define __ASSEMBLY__ 1 -#include <entry.h> -#include <sgidefs.h> -#include <sys/asm.h> - -#ifndef ENTRY_POINT -#error ENTRY_POINT needs to be defined for start.S on MIPS/ELF. -#endif - -/* This is the canonical entry point, usually the first thing in the text - segment. The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry - point runs, most registers' values are unspecified, except for: - - v0 ($2) Contains a function pointer to be registered with `atexit'. - This is how the dynamic linker arranges to have DT_FINI - functions called for shared libraries that have been loaded - before this code runs. - - sp ($29) The stack contains the arguments and environment: - 0(%esp) argc - 4(%esp) argv[0] - ... - (4*argc)(%esp) NULL - (4*(argc+1))(%esp) envp[0] - ... - NULL - ra ($31) The return address register is set to zero so that programs - that search backword through stack frames recognize the last - stack frame. -*/ - - -/* We need to call: - __libc_start_main (int (*main) (int, char **, char **), int argc, - char **argv, void (*init) (void), void (*fini) (void), - void (*rtld_fini) (void), void *stack_end) -*/ - - .text - .globl ENTRY_POINT - .type ENTRY_POINT,@function -ENTRY_POINT: -#ifdef __PIC__ - SETUP_GPX($0) - SETUP_GPX64($25,$0) -#else - PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */ - move $31, $0 -#endif - - PTR_LA $4, main /* main */ - PTR_L $5, 0($29) /* argc */ - PTR_ADDIU $6, $29, PTRSIZE /* argv */ - - /* Allocate space on the stack for seven arguments (o32 only) - and make sure the stack is aligned to double words (8 bytes) - on o32 and quad words (16 bytes) on n32 and n64. */ - - and $29, -2 * SZREG -#if _MIPS_SIM == _ABIO32 - PTR_SUBIU $29, 32 -#endif - PTR_LA $7, __libc_csu_init /* init */ - PTR_LA $8, __libc_csu_fini -#if _MIPS_SIM == _ABIO32 - PTR_S $8, 16($29) /* fini */ - PTR_S $2, 20($29) /* rtld_fini */ - PTR_S $29, 24($29) /* stack_end */ -#else - move $9, $2 /* rtld_fini */ - move $10, $29 /* stack_end */ -#endif - jal __libc_start_main -hlt: b hlt /* Crash if somehow it does return. */ - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/sysdeps/mips/fpregdef.h b/sysdeps/mips/fpregdef.h deleted file mode 100644 index 6f76d1183d..0000000000 --- a/sysdeps/mips/fpregdef.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FPREGDEF_H -#define _FPREGDEF_H - -#include <sys/fpregdef.h> - -#endif /* _FPREGDEF_H */ diff --git a/sysdeps/mips/fpu/e_sqrt.c b/sysdeps/mips/fpu/e_sqrt.c deleted file mode 100644 index 5449710aff..0000000000 --- a/sysdeps/mips/fpu/e_sqrt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -#include <sgidefs.h> - - -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) - -double -__ieee754_sqrt (double x) -{ - double z; - __asm__ ("sqrt.d %0,%1" : "=f" (z) : "f" (x)); - return z; -} - -#else - -#include <sysdeps/ieee754/dbl-64/e_sqrt.c> - -#endif diff --git a/sysdeps/mips/fpu/e_sqrtf.c b/sysdeps/mips/fpu/e_sqrtf.c deleted file mode 100644 index 3590ad46d5..0000000000 --- a/sysdeps/mips/fpu/e_sqrtf.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -#include <sgidefs.h> - - -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) - -float -__ieee754_sqrtf (float x) -{ - float z; - __asm__ ("sqrt.s %0,%1" : "=f" (z) : "f" (x)); - return z; -} - -#else - -#include <sysdeps/ieee754/flt-32/e_sqrtf.c> - -#endif - diff --git a/sysdeps/mips/fpu/fclrexcpt.c b/sysdeps/mips/fpu/fclrexcpt.c deleted file mode 100644 index f773312b34..0000000000 --- a/sysdeps/mips/fpu/fclrexcpt.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feclearexcept (int excepts) -{ - int cw; - - /* Mask out unsupported bits/exceptions. */ - excepts &= FE_ALL_EXCEPT; - - /* Read the complete control word. */ - _FPU_GETCW (cw); - - /* Clear exception flag bits and cause bits. If the cause bit is not - cleared, the next CTC instruction (just below) will re-generate the - exception. */ - - cw &= ~(excepts | (excepts << CAUSE_SHIFT)); - - /* Put the new data in effect. */ - _FPU_SETCW (cw); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fedisblxcpt.c b/sysdeps/mips/fpu/fedisblxcpt.c deleted file mode 100644 index 62e1a7130a..0000000000 --- a/sysdeps/mips/fpu/fedisblxcpt.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -fedisableexcept (int excepts) -{ - unsigned int new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc &= ~(excepts << ENABLE_SHIFT); - new_exc &= ~_FPU_RESERVED; - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/sysdeps/mips/fpu/feenablxcpt.c b/sysdeps/mips/fpu/feenablxcpt.c deleted file mode 100644 index 4c285811db..0000000000 --- a/sysdeps/mips/fpu/feenablxcpt.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feenableexcept (int excepts) -{ - unsigned int new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc |= excepts << ENABLE_SHIFT; - new_exc &= ~_FPU_RESERVED; - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/sysdeps/mips/fpu/fegetenv.c b/sysdeps/mips/fpu/fegetenv.c deleted file mode 100644 index c1741385fd..0000000000 --- a/sysdeps/mips/fpu/fegetenv.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Store current floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetenv (fenv_t *envp) -{ - _FPU_GETCW (*envp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fegetexcept.c b/sysdeps/mips/fpu/fegetexcept.c deleted file mode 100644 index 14b1241294..0000000000 --- a/sysdeps/mips/fpu/fegetexcept.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -fegetexcept (void) -{ - unsigned int exc; - - /* Get the current control word. */ - _FPU_GETCW (exc); - - return (exc & ENABLE_MASK) >> ENABLE_SHIFT; -} diff --git a/sysdeps/mips/fpu/fegetround.c b/sysdeps/mips/fpu/fegetround.c deleted file mode 100644 index efb1ba0dcc..0000000000 --- a/sysdeps/mips/fpu/fegetround.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Return current rounding direction. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetround (void) -{ - int cw; - - /* Get control word. */ - _FPU_GETCW (cw); - - return cw & 0x3; -} diff --git a/sysdeps/mips/fpu/feholdexcpt.c b/sysdeps/mips/fpu/feholdexcpt.c deleted file mode 100644 index bb37148fff..0000000000 --- a/sysdeps/mips/fpu/feholdexcpt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Store current floating-point environment and clear exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -feholdexcept (fenv_t *envp) -{ - fpu_control_t cw; - - /* Save the current state. */ - _FPU_GETCW (cw); - envp->__fp_control_register = cw; - - /* Clear all exception enable bits and flags. */ - cw &= ~(_FPU_MASK_V|_FPU_MASK_Z|_FPU_MASK_O|_FPU_MASK_U|_FPU_MASK_I|FE_ALL_EXCEPT); - _FPU_SETCW (cw); - - return 0; -} diff --git a/sysdeps/mips/fpu/fenv_libc.h b/sysdeps/mips/fpu/fenv_libc.h deleted file mode 100644 index d971d2c711..0000000000 --- a/sysdeps/mips/fpu/fenv_libc.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FENV_LIBC_H -#define _FENV_LIBC_H 1 - -/* Mask for enabling exceptions and for the CAUSE bits. */ -#define ENABLE_MASK 0x00F80U -#define CAUSE_MASK 0x1F000U - -/* Shift for FE_* flags to get up to the ENABLE bits and the CAUSE bits. */ -#define ENABLE_SHIFT 5 -#define CAUSE_SHIFT 10 - - -#endif /* _FENV_LIBC_H */ diff --git a/sysdeps/mips/fpu/fesetenv.c b/sysdeps/mips/fpu/fesetenv.c deleted file mode 100644 index b71a877ae3..0000000000 --- a/sysdeps/mips/fpu/fesetenv.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fesetenv (const fenv_t *envp) -{ - fpu_control_t cw; - - /* Read first current state to flush fpu pipeline. */ - _FPU_GETCW (cw); - - if (envp == FE_DFL_ENV) - _FPU_SETCW (_FPU_DEFAULT); - else if (envp == FE_NOMASK_ENV) - _FPU_SETCW (_FPU_IEEE); - else - _FPU_SETCW (envp->__fp_control_register); - - /* Success. */ - return 0; -} - -libm_hidden_def (fesetenv) diff --git a/sysdeps/mips/fpu/fesetround.c b/sysdeps/mips/fpu/fesetround.c deleted file mode 100644 index af73a720f8..0000000000 --- a/sysdeps/mips/fpu/fesetround.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fesetround (int round) -{ - unsigned short int cw; - - if ((round & ~0x3) != 0) - /* ROUND is no valid rounding mode. */ - return 1; - - /* Get current state. */ - _FPU_GETCW (cw); - - /* Set rounding bits. */ - cw &= ~0x3; - cw |= round; - /* Set new state. */ - _FPU_SETCW (cw); - - return 0; -} diff --git a/sysdeps/mips/fpu/feupdateenv.c b/sysdeps/mips/fpu/feupdateenv.c deleted file mode 100644 index 20b20e14c0..0000000000 --- a/sysdeps/mips/fpu/feupdateenv.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -feupdateenv (const fenv_t *envp) -{ - int temp; - - /* Save current exceptions. */ - _FPU_GETCW (temp); - temp &= FE_ALL_EXCEPT; - - /* Install new environment. */ - fesetenv (envp); - - /* Raise the safed exception. Incidently for us the implementation - defined format of the values in objects of type fexcept_t is the - same as the ones specified using the FE_* constants. */ - feraiseexcept (temp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fgetexcptflg.c b/sysdeps/mips/fpu/fgetexcptflg.c deleted file mode 100644 index 3412159816..0000000000 --- a/sysdeps/mips/fpu/fgetexcptflg.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetexceptflag (fexcept_t *flagp, int excepts) -{ - fexcept_t temp; - - /* Get the current exceptions. */ - _FPU_GETCW (temp); - - /* We only save the relevant bits here. In particular, care has to be - taken with the CAUSE bits, as an inadvertent restore later on could - generate unexpected exceptions. */ - - *flagp = temp & excepts & FE_ALL_EXCEPT; - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/fraiseexcpt.c b/sysdeps/mips/fpu/fraiseexcpt.c deleted file mode 100644 index 3e2ebe0fe7..0000000000 --- a/sysdeps/mips/fpu/fraiseexcpt.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fenv_libc.h> -#include <fpu_control.h> - -int -feraiseexcept (int excepts) -{ - fpu_control_t cw; - - /* Get current state. */ - _FPU_GETCW (cw); - - /* Set flag bits (which are accumulative), and *also* set the - cause bits. The setting of the cause bits is what actually causes - the hardware to generate the exception, if the corresponding enable - bit is set as well. */ - - excepts &= FE_ALL_EXCEPT; - cw |= excepts | (excepts << CAUSE_SHIFT); - - /* Set new state. */ - _FPU_SETCW (cw); - - return 0; -} - -libm_hidden_def (feraiseexcept) diff --git a/sysdeps/mips/fpu/fsetexcptflg.c b/sysdeps/mips/fpu/fsetexcptflg.c deleted file mode 100644 index c65d793178..0000000000 --- a/sysdeps/mips/fpu/fsetexcptflg.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - fexcept_t temp; - - /* Get the current exceptions. */ - _FPU_GETCW (temp); - - /* Make sure the flags we want restored are legal. */ - excepts &= FE_ALL_EXCEPT; - - /* Now clear the bits called for, and copy them in from flagp. Note that - we ignore all non-flag bits from *flagp, so they don't matter. */ - temp = (temp & ~excepts) | (*flagp & excepts); - - _FPU_SETCW (temp); - - /* Success. */ - return 0; -} diff --git a/sysdeps/mips/fpu/ftestexcept.c b/sysdeps/mips/fpu/ftestexcept.c deleted file mode 100644 index 6a833f7563..0000000000 --- a/sysdeps/mips/fpu/ftestexcept.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Test exception in current environment. - Copyright (C) 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fetestexcept (int excepts) -{ - int cw; - - /* Get current control word. */ - _FPU_GETCW (cw); - - return cw & excepts & FE_ALL_EXCEPT; -} diff --git a/sysdeps/mips/fpu/libm-test-ulps b/sysdeps/mips/fpu/libm-test-ulps deleted file mode 100644 index b514496676..0000000000 --- a/sysdeps/mips/fpu/libm-test-ulps +++ /dev/null @@ -1,890 +0,0 @@ -# Begin of automatic generation - -# atan2 -Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 -Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": -float: 1 -ifloat: 1 - -# atanh -Test "atanh (0.75) == 0.972955074527656652552676371721589865": -float: 1 -ifloat: 1 - -# cacosh -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -# casin -Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# casinh -Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 -Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 -Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# catan -Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -float: 3 -ifloat: 3 -Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i": -float: 4 -ifloat: 4 - -# catanh -Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -double: 4 -idouble: 4 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i": -float: 4 -ifloat: 4 -Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -double: 1 -idouble: 1 -Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i": -float: 6 -ifloat: 6 - -# cbrt -Test "cbrt (-27.0) == -3.0": -double: 1 -idouble: 1 -Test "cbrt (0.75) == 0.908560296416069829445605878163630251": -double: 1 -idouble: 1 -Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217": -double: 1 -idouble: 1 - -# ccos -Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": -float: 1 -ifloat: 1 -Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": -float: 1 -ifloat: 1 - -# ccosh -Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": -float: 1 -ifloat: 1 -Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -float: 1 -ifloat: 1 - -# cexp -Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i": -float: 1 -ifloat: 1 -Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i": -float: 1 -ifloat: 1 - -# clog -Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i": -float: 3 -ifloat: 3 -Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -float: 1 -ifloat: 1 - -# clog10 -Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 -Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i": -float: 1 -ifloat: 1 -Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i": -float: 1 -ifloat: 1 - -# cos -Test "cos (M_PI_6l * 2.0) == 0.5": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "cos (M_PI_6l * 4.0) == -0.5": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "cos (pi/2) == 0": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# cpow -Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 -Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": -double: 2 -float: 3 -idouble: 2 -ifloat: 3 -Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -double: 1 -float: 4 -idouble: 1 -ifloat: 4 -Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": -float: 2 -ifloat: 2 -Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -# csinh -Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": -double: 1 -idouble: 1 -Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 -Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -float: 1 -ifloat: 1 - -# csqrt -Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 -Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": -float: 1 -ifloat: 1 - -# ctan -Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": -double: 1 -idouble: 1 -Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -double: 1 -idouble: 1 - -# ctanh -Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": -float: 1 -ifloat: 1 -Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": -double: 1 -idouble: 1 - -# erf -Test "erf (1.25) == 0.922900128256458230136523481197281140": -double: 1 -idouble: 1 - -# erfc -Test "erfc (2.0) == 0.00467773498104726583793074363274707139": -double: 1 -idouble: 1 -Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8": -double: 1 -idouble: 1 - -# exp10 -Test "exp10 (-1) == 0.1": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "exp10 (0.75) == 5.62341325190349080394951039776481231": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "exp10 (3) == 1000": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -# expm1 -Test "expm1 (0.75) == 1.11700001661267466854536981983709561": -double: 1 -idouble: 1 -Test "expm1 (1) == M_El - 1.0": -float: 1 -ifloat: 1 - -# hypot -Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 -Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271": -float: 1 -ifloat: 1 - -# j0 -Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "j0 (10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "j0 (2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "j0 (8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 - -# j1 -Test "j1 (10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "j1 (2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "j1 (8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 - -# jn -Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 0.75) == 0.864242275166648623555731103820923211": -float: 1 -ifloat: 1 -Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": -float: 2 -ifloat: 2 -Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": -float: 1 -ifloat: 1 -Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": -float: 2 -ifloat: 2 -Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": -double: 1 -idouble: 1 -Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": -double: 1 -idouble: 1 -Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": -double: 4 -float: 3 -idouble: 4 -ifloat: 3 -Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": -float: 4 -ifloat: 4 -Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# lgamma -Test "lgamma (0.7) == 0.260867246531666514385732417016759578": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# log10 -Test "log10 (0.75) == -0.124938736608299953132449886193870744": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "log10 (e) == log10(e)": -float: 1 -ifloat: 1 - -# log1p -Test "log1p (-0.25) == -0.287682072451780927439219005993827432": -float: 1 -ifloat: 1 - -# sincos -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": -float: 1 -ifloat: 1 - -# tan -Test "tan (pi/4) == 1": -double: 1 -idouble: 1 - -# tgamma -Test "tgamma (-0.5) == -2 sqrt (pi)": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "tgamma (0.5) == sqrt (pi)": -float: 1 -ifloat: 1 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y0 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "y0 (8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -# y1 -Test "y1 (0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "y1 (1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "y1 (10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "y1 (2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "y1 (8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -# yn -Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": -float: 1 -ifloat: 1 -Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": -double: 1 -idouble: 1 -Test "yn (1, 1.5) == -0.412308626973911295952829820633445323": -float: 1 -ifloat: 1 -Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": -double: 3 -float: 1 -idouble: 3 -ifloat: 1 -Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 -Test "yn (10, 0.125) == -127057845771019398.252538486899753195": -double: 1 -idouble: 1 -Test "yn (10, 0.75) == -2133501638.90573424452445412893839236": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 1.0) == -121618014.278689189288130426667971145": -double: 1 -idouble: 1 -Test "yn (10, 10.0) == -0.359814152183402722051986577343560609": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (10, 2.0) == -129184.542208039282635913145923304214": -double: 2 -idouble: 2 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": -double: 1 -idouble: 1 -Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 -Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": -double: 1 -idouble: 1 - -# Maximal error of functions: -Function: "atan2": -float: 3 -ifloat: 3 - -Function: "atanh": -float: 1 -ifloat: 1 - -Function: Real part of "cacosh": -double: 1 -float: 7 -idouble: 1 -ifloat: 7 - -Function: Imaginary part of "cacosh": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 - -Function: Real part of "casin": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "casinh": -double: 5 -float: 1 -idouble: 5 -ifloat: 1 - -Function: Imaginary part of "casinh": -double: 3 -float: 6 -idouble: 3 -ifloat: 6 - -Function: Real part of "catan": -float: 4 -ifloat: 4 - -Function: Imaginary part of "catan": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "catanh": -double: 4 -idouble: 4 - -Function: Imaginary part of "catanh": -float: 6 -ifloat: 6 - -Function: "cbrt": -double: 1 -idouble: 1 - -Function: Real part of "ccos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccos": -float: 1 -ifloat: 1 - -Function: Real part of "ccosh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "ccosh": -float: 1 -ifloat: 1 - -Function: Real part of "cexp": -float: 1 -ifloat: 1 - -Function: Imaginary part of "cexp": -float: 1 -ifloat: 1 - -Function: Real part of "clog": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog": -float: 3 -ifloat: 3 - -Function: Real part of "clog10": -float: 1 -ifloat: 1 - -Function: Imaginary part of "clog10": -double: 1 -float: 5 -idouble: 1 -ifloat: 5 - -Function: "cos": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: Real part of "cpow": -double: 2 -float: 4 -idouble: 2 -ifloat: 4 - -Function: Imaginary part of "cpow": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: Real part of "csinh": -float: 1 -ifloat: 1 - -Function: Imaginary part of "csinh": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "csqrt": -float: 1 -ifloat: 1 - -Function: Real part of "ctan": -double: 1 -idouble: 1 - -Function: Imaginary part of "ctan": -double: 1 -idouble: 1 - -Function: Real part of "ctanh": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: Imaginary part of "ctanh": -float: 1 -ifloat: 1 - -Function: "erf": -double: 1 -idouble: 1 - -Function: "erfc": -double: 1 -idouble: 1 - -Function: "exp10": -double: 6 -float: 2 -idouble: 6 -ifloat: 2 - -Function: "expm1": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "hypot": -float: 1 -ifloat: 1 - -Function: "j0": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 - -Function: "j1": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "jn": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 - -Function: "lgamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log10": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 - -Function: "log1p": -float: 1 -ifloat: 1 - -Function: "sincos": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "tan": -double: 1 -idouble: 1 - -Function: "tgamma": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "y0": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: "y1": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -Function: "yn": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 - -# end of automatic generation diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h deleted file mode 100644 index da18deab5a..0000000000 --- a/sysdeps/mips/fpu_control.h +++ /dev/null @@ -1,98 +0,0 @@ -/* FPU control word bits. Mips version. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Olaf Flebbe and Ralf Baechle. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H - -/* MIPS FPU floating point control register bits. - * - * 31-25 -> floating point conditions code bits 7-1. These bits are only - * available in MIPS IV. - * 24 -> flush denormalized results to zero instead of - * causing unimplemented operation exception. This bit is only - * available for MIPS III and newer. - * 23 -> Condition bit - * 22-18 -> reserved (read as 0, write with 0) - * 17 -> cause bit for unimplemented operation - * 16 -> cause bit for invalid exception - * 15 -> cause bit for division by zero exception - * 14 -> cause bit for overflow exception - * 13 -> cause bit for underflow exception - * 12 -> cause bit for inexact exception - * 11 -> enable exception for invalid exception - * 10 -> enable exception for division by zero exception - * 9 -> enable exception for overflow exception - * 8 -> enable exception for underflow exception - * 7 -> enable exception for inexact exception - * 6 -> flag invalid exception - * 5 -> flag division by zero exception - * 4 -> flag overflow exception - * 3 -> flag underflow exception - * 2 -> flag inexact exception - * 1-0 -> rounding control - * - * - * Rounding Control: - * 00 - rounding to nearest (RN) - * 01 - rounding toward zero (RZ) - * 10 - rounding (up) toward plus infinity (RP) - * 11 - rounding (down)toward minus infinity (RM) - */ - -#include <features.h> - -/* masking of interrupts */ -#define _FPU_MASK_V 0x0800 /* Invalid operation */ -#define _FPU_MASK_Z 0x0400 /* Division by zero */ -#define _FPU_MASK_O 0x0200 /* Overflow */ -#define _FPU_MASK_U 0x0100 /* Underflow */ -#define _FPU_MASK_I 0x0080 /* Inexact operation */ - -/* flush denormalized numbers to zero */ -#define _FPU_FLUSH_TZ 0x1000000 - -/* rounding control */ -#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RC_ZERO 0x1 -#define _FPU_RC_UP 0x2 -#define _FPU_RC_DOWN 0x3 - -#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */ - - -/* The fdlibm code requires strict IEEE double precision arithmetic, - and no interrupts for exceptions, rounding to nearest. */ - -#define _FPU_DEFAULT 0x00000000 - -/* IEEE: same as above, but exceptions */ -#define _FPU_IEEE 0x00000F80 - -/* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); - -/* Macros for accessing the hardware control word. */ -#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw)) -#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw)) - -/* Default control word set at startup. */ -extern fpu_control_t __fpu_control; - -#endif /* fpu_control.h */ diff --git a/sysdeps/mips/gccframe.h b/sysdeps/mips/gccframe.h deleted file mode 100644 index ec9311caca..0000000000 --- a/sysdeps/mips/gccframe.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Definition of object in frame unwind info. mips version. - Copyright (C) 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define FIRST_PSEUDO_REGISTER 76 - -#include <sysdeps/generic/gccframe.h> diff --git a/sysdeps/mips/ieee754.h b/sysdeps/mips/ieee754.h deleted file mode 100644 index ed13de2775..0000000000 --- a/sysdeps/mips/ieee754.h +++ /dev/null @@ -1,325 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1999, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _IEEE754_H - -#define _IEEE754_H 1 -#include <features.h> - -#include <endian.h> - -#include <float.h> - -__BEGIN_DECLS - -union ieee754_float - { - float f; - - /* This is the IEEE 754 single-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:8; - unsigned int mantissa:23; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int mantissa:23; - unsigned int exponent:8; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:8; - unsigned int quiet_nan:1; - unsigned int mantissa:22; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int mantissa:22; - unsigned int quiet_nan:1; - unsigned int exponent:8; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee_nan; - }; - -#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */ - - -union ieee754_double - { - double d; - - /* This is the IEEE 754 double-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:11; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:20; - unsigned int mantissa1:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:11; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:19; - unsigned int mantissa1:32; -#else -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#endif - } ieee_nan; - }; - -#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - -#if LDBL_MANT_DIG == 113 - -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 quad-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:16; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:16; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:15; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:15; - unsigned int quiet_nan:1; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ - -#elif LDBL_MANT_DIG == 64 - -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 double-extended-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int empty:16; - unsigned int mantissa0:32; - unsigned int mantissa1:32; -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; - unsigned int mantissa0:32; - unsigned int mantissa1:32; -# else - unsigned int mantissa1:32; - unsigned int mantissa0:32; - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; -# endif -#endif - } ieee; - - /* This is for NaNs in the IEEE 854 double-extended-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int empty:16; - unsigned int one:1; - unsigned int quiet_nan:1; - unsigned int mantissa0:30; - unsigned int mantissa1:32; -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; - unsigned int mantissa0:30; - unsigned int quiet_nan:1; - unsigned int one:1; - unsigned int mantissa1:32; -# else - unsigned int mantissa1:32; - unsigned int mantissa0:30; - unsigned int quiet_nan:1; - unsigned int one:1; - unsigned int exponent:15; - unsigned int negative:1; - unsigned int empty:16; -# endif -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff - -#elif LDBL_MANT_DIG == 53 - -union ieee854_long_double - { - long double d; - - /* This is the IEEE 754 double-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:11; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:20; - unsigned int mantissa1:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:20; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:11; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:19; - unsigned int mantissa1:32; -#else -# if __FLOAT_WORD_ORDER == BIG_ENDIAN - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; - unsigned int mantissa1:32; -# else - /* Together these comprise the mantissa. */ - unsigned int mantissa1:32; - unsigned int mantissa0:19; - unsigned int quiet_nan:1; - unsigned int exponent:11; - unsigned int negative:1; -# endif -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - -#endif /* LDBL_MANT_DIG == 53 */ - -__END_DECLS - -#endif /* ieee754.h */ diff --git a/sysdeps/mips/init-first.c b/sysdeps/mips/init-first.c deleted file mode 100644 index b67a44431c..0000000000 --- a/sysdeps/mips/init-first.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. For mips/Unix. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <unistd.h> - -extern void __libc_init (int, char **, char **); -extern void __libc_global_ctors (void); - - -static void -init (int *data) -{ - int argc = *data; - char **argv = (void *) (data + 1); - char **envp = &argv[argc + 1]; - - __environ = envp; - __libc_init (argc, argv, envp); -} - -#ifdef SHARED -/* This function is called to initialize the shared C library. - It is called just before the user _start code from mips/elf/start.S, - with the stack set up as that code gets it. */ - -/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT - pointer in the dynamic section based solely on that. It is convention - for this function to be in the `.init' section, but the symbol name is - the only thing that really matters!! */ -/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ - -void -_init (int argc, ...) -{ - init (&argc); - - __libc_global_ctors (); -} -#endif - - -void -__libc_init_first (int argc __attribute__ ((unused)), ...) -{ -#ifndef SHARED - init (&argc); -#endif -} diff --git a/sysdeps/mips/jmpbuf-unwind.h b/sysdeps/mips/jmpbuf-unwind.h deleted file mode 100644 index bfa1a64537..0000000000 --- a/sysdeps/mips/jmpbuf-unwind.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> -#include <stdint.h> -#include <unwind.h> -#include <sysdep.h> - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp)) - -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) - -static inline uintptr_t __attribute__ ((unused)) -_jmpbuf_sp (__jmp_buf regs) -{ - uintptr_t sp = regs[0].__sp; -#ifdef PTR_DEMANGLE - PTR_DEMANGLE (sp); -#endif - return sp; -} - -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ - ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) - -/* We use the normal longjmp for unwinding. */ -#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val) diff --git a/sysdeps/mips/libc-tls.c b/sysdeps/mips/libc-tls.c deleted file mode 100644 index a3d6301d1d..0000000000 --- a/sysdeps/mips/libc-tls.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <csu/libc-tls.c> -#include <dl-tls.h> - -#if USE_TLS - -/* On MIPS, linker optimizations are not required, so __tls_get_addr - can be called even in statically linked binaries. In this case module - must be always 1 and PT_TLS segment exist in the binary, otherwise it - would not link. */ - -void * -__tls_get_addr (tls_index *ti) -{ - dtv_t *dtv = THREAD_DTV (); - return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET; -} - -#endif diff --git a/sysdeps/mips/lshift.S b/sysdeps/mips/lshift.S deleted file mode 100644 index 0217bfc586..0000000000 --- a/sysdeps/mips/lshift.S +++ /dev/null @@ -1,98 +0,0 @@ -/* MIPS2 __mpn_lshift -- - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - src_ptr $5 - size $6 - cnt $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_lshift) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - sll $2,$6,2 - addu $5,$5,$2 /* make r5 point at end of src */ - lw $10,-4($5) /* load first limb */ - subu $13,$0,$7 - addu $4,$4,$2 /* make r4 point at end of res */ - addiu $6,$6,-1 - and $9,$6,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - srl $2,$10,$13 /* compute function result */ - - subu $6,$6,$9 - -L(Loop0): lw $3,-8($5) - addiu $4,$4,-4 - addiu $5,$5,-4 - addiu $9,$9,-1 - sll $11,$10,$7 - srl $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sw $8,0($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): lw $3,-8($5) - addiu $4,$4,-16 - addiu $6,$6,-4 - sll $11,$10,$7 - srl $12,$3,$13 - - lw $10,-12($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,12($4) - srl $9,$10,$13 - - lw $3,-16($5) - sll $11,$10,$7 - or $8,$14,$9 - sw $8,8($4) - srl $12,$3,$13 - - lw $10,-20($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,4($4) - srl $9,$10,$13 - - addiu $5,$5,-16 - or $8,$14,$9 - bgtz $6,L(Loop) - sw $8,0($4) - -L(Lend): sll $8,$10,$7 - j $31 - sw $8,-4($4) - END (__mpn_lshift) diff --git a/sysdeps/mips/machine-gmon.h b/sysdeps/mips/machine-gmon.h deleted file mode 100644 index 7a089fa595..0000000000 --- a/sysdeps/mips/machine-gmon.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Machine-specific calling sequence for `mcount' profiling function. MIPS - Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sgidefs.h> - -#define _MCOUNT_DECL(frompc,selfpc) \ -static void __attribute_used__ __mcount (u_long frompc, u_long selfpc) - -/* Call __mcount with the return PC for our caller, - and the return PC our caller will return to. */ - -#if _MIPS_SIM == _ABIO32 - -#ifdef __PIC__ -# define CPLOAD ".cpload $25;" -# define CPRESTORE ".cprestore 44\n\t" -#else -# define CPLOAD -# define CPRESTORE -#endif - -#define MCOUNT asm(\ - ".globl _mcount;\n\t" \ - ".align 2;\n\t" \ - ".type _mcount,@function;\n\t" \ - ".ent _mcount\n\t" \ - "_mcount:\n\t" \ - ".frame $sp,44,$31\n\t" \ - ".set noreorder;\n\t" \ - ".set noat;\n\t" \ - CPLOAD \ - "subu $29,$29,48;\n\t" \ - CPRESTORE \ - "sw $4,24($29);\n\t" \ - "sw $5,28($29);\n\t" \ - "sw $6,32($29);\n\t" \ - "sw $7,36($29);\n\t" \ - "sw $2,40($29);\n\t" \ - "sw $1,16($29);\n\t" \ - "sw $31,20($29);\n\t" \ - "move $5,$31;\n\t" \ - "move $4,$1;\n\t" \ - "jal __mcount;\n\t" \ - "nop;\n\t" \ - "lw $4,24($29);\n\t" \ - "lw $5,28($29);\n\t" \ - "lw $6,32($29);\n\t" \ - "lw $7,36($29);\n\t" \ - "lw $2,40($29);\n\t" \ - "lw $31,20($29);\n\t" \ - "lw $1,16($29);\n\t" \ - "addu $29,$29,56;\n\t" \ - "j $31;\n\t" \ - "move $31,$1;\n\t" \ - ".set reorder;\n\t" \ - ".set at\n\t" \ - ".end _mcount"); - -#else - -#ifdef __PIC__ -# define CPSETUP ".cpsetup $25, 88, _mcount;" -# define CPRETURN ".cpreturn;" -#else -# define CPSETUP -# define CPRETURN -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADDU_STRING "add" /* no u */ -# define PTR_SUBU_STRING "sub" /* no u */ -#elif _MIPS_SIM == _ABI64 -# define PTR_ADDU_STRING "daddu" -# define PTR_SUBU_STRING "dsubu" -#else -# error "Unknown ABI" -#endif - -#define MCOUNT asm(\ - ".globl _mcount;\n\t" \ - ".align 3;\n\t" \ - ".type _mcount,@function;\n\t" \ - ".ent _mcount\n\t" \ - "_mcount:\n\t" \ - ".frame $sp,88,$31\n\t" \ - ".set noreorder;\n\t" \ - ".set noat;\n\t" \ - PTR_SUBU_STRING " $29,$29,96;\n\t" \ - CPSETUP \ - "sd $4,24($29);\n\t" \ - "sd $5,32($29);\n\t" \ - "sd $6,40($29);\n\t" \ - "sd $7,48($29);\n\t" \ - "sd $8,56($29);\n\t" \ - "sd $9,64($29);\n\t" \ - "sd $10,72($29);\n\t" \ - "sd $11,80($29);\n\t" \ - "sd $2,16($29);\n\t" \ - "sd $1,0($29);\n\t" \ - "sd $31,8($29);\n\t" \ - "move $5,$31;\n\t" \ - "move $4,$1;\n\t" \ - "jal __mcount;\n\t" \ - "nop;\n\t" \ - "ld $4,24($29);\n\t" \ - "ld $5,32($29);\n\t" \ - "ld $6,40($29);\n\t" \ - "ld $7,48($29);\n\t" \ - "ld $8,56($29);\n\t" \ - "ld $9,64($29);\n\t" \ - "ld $10,72($29);\n\t" \ - "ld $11,80($29);\n\t" \ - "ld $2,16($29);\n\t" \ - "ld $31,8($29);\n\t" \ - "ld $1,0($29);\n\t" \ - CPRETURN \ - PTR_ADDU_STRING " $29,$29,96;\n\t" \ - "j $31;\n\t" \ - "move $31,$1;\n\t" \ - ".set reorder;\n\t" \ - ".set at\n\t" \ - ".end _mcount"); - -#endif diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S deleted file mode 100644 index 2049d05829..0000000000 --- a/sysdeps/mips/memcpy.S +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <endian.h> - - -/* void *memcpy(void *s1, const void *s2, size_t n); */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define LWHI lwl /* high part is left in big-endian */ -# define SWHI swl /* high part is left in big-endian */ -# define LWLO lwr /* low part is right in big-endian */ -# define SWLO swr /* low part is right in big-endian */ -#else -# define LWHI lwr /* high part is right in little-endian */ -# define SWHI swr /* high part is right in little-endian */ -# define LWLO lwl /* low part is left in little-endian */ -# define SWLO swl /* low part is left in little-endian */ -#endif - -ENTRY (memcpy) - .set noreorder - - slti t0, a2, 8 # Less than 8? - bne t0, zero, L(last8) - move v0, a0 # Setup exit value before too late - - xor t0, a1, a0 # Find a0/a1 displacement - andi t0, 0x3 - bne t0, zero, L(shift) # Go handle the unaligned case - subu t1, zero, a1 - andi t1, 0x3 # a0/a1 are aligned, but are we - beq t1, zero, L(chk8w) # starting in the middle of a word? - subu a2, t1 - LWHI t0, 0(a1) # Yes we are... take care of that - addu a1, t1 - SWHI t0, 0(a0) - addu a0, t1 - -L(chk8w): - andi t0, a2, 0x1f # 32 or more bytes left? - beq t0, a2, L(chk1w) - subu a3, a2, t0 # Yes - addu a3, a1 # a3 = end address of loop - move a2, t0 # a2 = what will be left after loop -L(lop8w): - lw t0, 0(a1) # Loop taking 8 words at a time - lw t1, 4(a1) - lw t2, 8(a1) - lw t3, 12(a1) - lw t4, 16(a1) - lw t5, 20(a1) - lw t6, 24(a1) - lw t7, 28(a1) - addiu a0, 32 - addiu a1, 32 - sw t0, -32(a0) - sw t1, -28(a0) - sw t2, -24(a0) - sw t3, -20(a0) - sw t4, -16(a0) - sw t5, -12(a0) - sw t6, -8(a0) - bne a1, a3, L(lop8w) - sw t7, -4(a0) - -L(chk1w): - andi t0, a2, 0x3 # 4 or more bytes left? - beq t0, a2, L(last8) - subu a3, a2, t0 # Yes, handle them one word at a time - addu a3, a1 # a3 again end address - move a2, t0 -L(lop1w): - lw t0, 0(a1) - addiu a0, 4 - addiu a1, 4 - bne a1, a3, L(lop1w) - sw t0, -4(a0) - -L(last8): - blez a2, L(lst8e) # Handle last 8 bytes, one at a time - addu a3, a2, a1 -L(lst8l): - lb t0, 0(a1) - addiu a0, 1 - addiu a1, 1 - bne a1, a3, L(lst8l) - sb t0, -1(a0) -L(lst8e): - jr ra # Bye, bye - nop - -L(shift): - subu a3, zero, a0 # Src and Dest unaligned - andi a3, 0x3 # (unoptimized case...) - beq a3, zero, L(shft1) - subu a2, a3 # a2 = bytes left - LWHI t0, 0(a1) # Take care of first odd part - LWLO t0, 3(a1) - addu a1, a3 - SWHI t0, 0(a0) - addu a0, a3 -L(shft1): - andi t0, a2, 0x3 - subu a3, a2, t0 - addu a3, a1 -L(shfth): - LWHI t1, 0(a1) # Limp through, word by word - LWLO t1, 3(a1) - addiu a0, 4 - addiu a1, 4 - bne a1, a3, L(shfth) - sw t1, -4(a0) - b L(last8) # Handle anything which may be left - move a2, t0 - - .set reorder -END (memcpy) -libc_hidden_builtin_def (memcpy) diff --git a/sysdeps/mips/memset.S b/sysdeps/mips/memset.S deleted file mode 100644 index 694ee8f1dc..0000000000 --- a/sysdeps/mips/memset.S +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <endian.h> - - -/* void *memset(void *s, int c, size_t n). */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define SWHI swl /* high part is left in big-endian */ -#else -# define SWHI swr /* high part is right in little-endian */ -#endif - -ENTRY (memset) - .set noreorder - - slti t1, a2, 8 # Less than 8? - bne t1, zero, L(last8) - move v0, a0 # Setup exit value before too late - - beq a1, zero, L(ueven) # If zero pattern, no need to extend - andi a1, 0xff # Avoid problems with bogus arguments - sll t0, a1, 8 - or a1, t0 - sll t0, a1, 16 - or a1, t0 # a1 is now pattern in full word - -L(ueven): - subu t0, zero, a0 # Unaligned address? - andi t0, 0x3 - beq t0, zero, L(chkw) - subu a2, t0 - SWHI a1, 0(a0) # Yes, handle first unaligned part - addu a0, t0 # Now both a0 and a2 are updated - -L(chkw): - andi t0, a2, 0x7 # Enough left for one loop iteration? - beq t0, a2, L(chkl) - subu a3, a2, t0 - addu a3, a0 # a3 is last loop address +1 - move a2, t0 # a2 is now # of bytes left after loop -L(loopw): - addiu a0, 8 # Handle 2 words pr. iteration - sw a1, -8(a0) - bne a0, a3, L(loopw) - sw a1, -4(a0) - -L(chkl): - andi t0, a2, 0x4 # Check if there is at least a full - beq t0, zero, L(last8) # word remaining after the loop - subu a2, t0 - sw a1, 0(a0) # Yes... - addiu a0, 4 - -L(last8): - blez a2, L(exit) # Handle last 8 bytes (if cnt>0) - addu a3, a2, a0 # a3 is last address +1 -L(lst8l): - addiu a0, 1 - bne a0, a3, L(lst8l) - sb a1, -1(a0) -L(exit): - j ra # Bye, bye - nop - - .set reorder -END (memset) -libc_hidden_builtin_def (memset) diff --git a/sysdeps/mips/memusage.h b/sysdeps/mips/memusage.h deleted file mode 100644 index dc1cc9ca14..0000000000 --- a/sysdeps/mips/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("$29"); stack_ptr; }) - -#include <sysdeps/generic/memusage.h> diff --git a/sysdeps/mips/mips32/Implies b/sysdeps/mips/mips32/Implies deleted file mode 100644 index fab98d7312..0000000000 --- a/sysdeps/mips/mips32/Implies +++ /dev/null @@ -1,2 +0,0 @@ -mips -wordsize-32 diff --git a/sysdeps/mips/mips32/Makefile b/sysdeps/mips/mips32/Makefile deleted file mode 100644 index dec0b024c3..0000000000 --- a/sysdeps/mips/mips32/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(filter -mabi=32,$(CC)),) -CC += -mabi=32 -endif diff --git a/sysdeps/mips/mips64/Implies b/sysdeps/mips/mips64/Implies deleted file mode 100644 index 8c18cb3034..0000000000 --- a/sysdeps/mips/mips64/Implies +++ /dev/null @@ -1,3 +0,0 @@ -# MIPS uses IEEE 754 floating point. -ieee754/flt-32 -ieee754/dbl-64 diff --git a/sysdeps/mips/mips64/Versions b/sysdeps/mips/mips64/Versions deleted file mode 100644 index 253a65f04e..0000000000 --- a/sysdeps/mips/mips64/Versions +++ /dev/null @@ -1,7 +0,0 @@ -libm { - GLIBC_2.1 { - # A generic bug got this omitted from other configurations' version - # sets, but we always had it. - exp2l; - } -} diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c deleted file mode 100644 index 546493f842..0000000000 --- a/sysdeps/mips/mips64/__longjmp.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> -#include <sgidefs.h> -#include <stdlib.h> - -#undef __longjmp - -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - -void -__longjmp (env, val_arg) - __jmp_buf env; - int val_arg; -{ - /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before - the hack around it); force it to use $a1 for the longjmp value. - Without this it saves $a1 in a register which gets clobbered - along the way. */ - register int val asm ("a1"); - - /* Pull back the floating point callee-saved registers. */ -#if _MIPS_SIM == _ABI64 - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f25, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f27, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f29, %0" : : "m" (env[0].__fpregs[5])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[6])); - asm volatile ("l.d $f31, %0" : : "m" (env[0].__fpregs[7])); -#else - asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); - asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); - asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); - asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); - asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); - asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); -#endif - - /* Get and reconstruct the floating point csr. */ - asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); - asm volatile ("ctc1 $2, $31"); - - /* Get the GP. */ - asm volatile ("ld $gp, %0" : : "m" (env[0].__gp)); - - /* Get the callee-saved registers. */ - asm volatile ("ld $16, %0" : : "m" (env[0].__regs[0])); - asm volatile ("ld $17, %0" : : "m" (env[0].__regs[1])); - asm volatile ("ld $18, %0" : : "m" (env[0].__regs[2])); - asm volatile ("ld $19, %0" : : "m" (env[0].__regs[3])); - asm volatile ("ld $20, %0" : : "m" (env[0].__regs[4])); - asm volatile ("ld $21, %0" : : "m" (env[0].__regs[5])); - asm volatile ("ld $22, %0" : : "m" (env[0].__regs[6])); - asm volatile ("ld $23, %0" : : "m" (env[0].__regs[7])); - - /* Get the PC. */ - asm volatile ("ld $31, %0" : : "m" (env[0].__pc)); - - - /* Restore the stack pointer and the FP. They have to be restored - last and in a single asm as gcc, depending on options used, may - use either of them to access env. */ - asm volatile ("ld $29, %0\n\t" - "ld $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); - -/* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ - if (val == 0) - asm volatile ("dli $2, 1"); - else - asm volatile ("move $2, %0" : : "r" (val)); - - asm volatile ("j $31"); - - /* Avoid `volatile function does return' warnings. */ - for (;;); -} diff --git a/sysdeps/mips/mips64/add_n.S b/sysdeps/mips/mips64/add_n.S deleted file mode 100644 index 072f4f0b73..0000000000 --- a/sysdeps/mips/mips64/add_n.S +++ /dev/null @@ -1,130 +0,0 @@ -/* MIPS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and - * store sum in a third limb vector. - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* - * INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * s2_ptr $6 - * size $7 - */ -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_add_n - .ent __mpn_add_n -__mpn_add_n: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) - ld $11,0($6) - - daddiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - move $2,$0 - - dsubu $7,$7,$9 - -L(Loop0): daddiu $9,$9,-1 - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - or $2,$2,$8 - - daddiu $5,$5,8 - daddiu $6,$6,8 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - daddiu $4,$4,8 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): daddiu $7,$7,-4 - - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - or $2,$2,$8 - - ld $10,16($5) - daddu $13,$13,$2 - ld $11,16($6) - sltu $8,$13,$2 - daddu $13,$12,$13 - sltu $2,$13,$12 - sd $13,8($4) - or $2,$2,$8 - - ld $12,24($5) - daddu $11,$11,$2 - ld $13,24($6) - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,16($4) - or $2,$2,$8 - - ld $10,32($5) - daddu $13,$13,$2 - ld $11,32($6) - sltu $8,$13,$2 - daddu $13,$12,$13 - sltu $2,$13,$12 - sd $13,24($4) - or $2,$2,$8 - - daddiu $5,$5,32 - daddiu $6,$6,32 - - bne $7,$0,L(Loop) - daddiu $4,$4,32 - -L(Lend): daddu $11,$11,$2 - sltu $8,$11,$2 - daddu $11,$10,$11 - sltu $2,$11,$10 - sd $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_add_n diff --git a/sysdeps/mips/mips64/addmul_1.S b/sysdeps/mips/mips64/addmul_1.S deleted file mode 100644 index f5ecd83702..0000000000 --- a/sysdeps/mips/mips64/addmul_1.S +++ /dev/null @@ -1,107 +0,0 @@ -/* MIPS3 __mpn_addmul_1 -- Multiply a limb vector with a single limb and - * add the product to a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef PIC - .option pic2 -#endif - .text - .align 4 - .globl __mpn_addmul_1 - .ent __mpn_addmul_1 -__mpn_addmul_1: -#ifdef PIC - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): ld $10,0($4) - mflo $3 - mfhi $9 - daddiu $5,$5,8 - daddu $3,$3,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dmultu $8,$7 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - daddu $3,$10,$3 - sltu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_addmul_1 diff --git a/sysdeps/mips/mips64/bsd-_setjmp.S b/sysdeps/mips/mips64/bsd-_setjmp.S deleted file mode 100644 index 7620cf391f..0000000000 --- a/sysdeps/mips/mips64/bsd-_setjmp.S +++ /dev/null @@ -1,49 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version. - Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 0)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (_setjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp)) - PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 - move a1, zero /* Pass a second argument of zero. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end _setjmp -libc_hidden_def (_setjmp) diff --git a/sysdeps/mips/mips64/bsd-setjmp.S b/sysdeps/mips/mips64/bsd-setjmp.S deleted file mode 100644 index 2a1fd9ce71..0000000000 --- a/sysdeps/mips/mips64/bsd-setjmp.S +++ /dev/null @@ -1,47 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version. - Copyright (C) 1996, 1997, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - -#include <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -#ifdef PIC - .option pic2 -#endif -ENTRY (setjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp)) - PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 - dli a1, 1 /* Pass a second argument of one. */ -#ifdef __PIC__ - jr t9 -#else - j C_SYMBOL_NAME (__sigsetjmp) -#endif - .end setjmp diff --git a/sysdeps/mips/mips64/gmp-mparam.h b/sysdeps/mips/mips64/gmp-mparam.h deleted file mode 100644 index 7666137a21..0000000000 --- a/sysdeps/mips/mips64/gmp-mparam.h +++ /dev/null @@ -1,31 +0,0 @@ -/* gmp-mparam.h -- Compiler/machine parameter header file. - -Copyright (C) 1991, 1993, 1994, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#if defined __GMP_H__ && ! defined _LONG_LONG_LIMB -#error "Included too late for _LONG_LONG_LIMB to take effect" -#endif - -#define _LONG_LONG_LIMB -#define BITS_PER_MP_LIMB 64 -#define BYTES_PER_MP_LIMB 8 -#define BITS_PER_LONGINT __WORDSIZE -#define BITS_PER_INT 32 -#define BITS_PER_SHORTINT 16 -#define BITS_PER_CHAR 8 diff --git a/sysdeps/mips/mips64/lshift.S b/sysdeps/mips/mips64/lshift.S deleted file mode 100644 index 20f9e3da19..0000000000 --- a/sysdeps/mips/mips64/lshift.S +++ /dev/null @@ -1,105 +0,0 @@ -/* MIPS3 __mpn_lshift -- - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * src_ptr $5 - * size $6 - * cnt $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_lshift - .ent __mpn_lshift -__mpn_lshift: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - dsll $2,$6,3 - daddu $5,$5,$2 # make r5 point at end of src - ld $10,-8($5) # load first limb - dsubu $13,$0,$7 - daddu $4,$4,$2 # make r4 point at end of res - daddiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - dsrl $2,$10,$13 # compute function result - - dsubu $6,$6,$9 - -L(Loop0): ld $3,-16($5) - daddiu $4,$4,-8 - daddiu $5,$5,-8 - daddiu $9,$9,-1 - dsll $11,$10,$7 - dsrl $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sd $8,0($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): ld $3,-16($5) - daddiu $4,$4,-32 - daddiu $6,$6,-4 - dsll $11,$10,$7 - dsrl $12,$3,$13 - - ld $10,-24($5) - dsll $14,$3,$7 - or $8,$11,$12 - sd $8,24($4) - dsrl $9,$10,$13 - - ld $3,-32($5) - dsll $11,$10,$7 - or $8,$14,$9 - sd $8,16($4) - dsrl $12,$3,$13 - - ld $10,-40($5) - dsll $14,$3,$7 - or $8,$11,$12 - sd $8,8($4) - dsrl $9,$10,$13 - - daddiu $5,$5,-32 - or $8,$14,$9 - bgtz $6,L(Loop) - sd $8,0($4) - -L(Lend): dsll $8,$10,$7 - j $31 - sd $8,-8($4) - .end __mpn_lshift diff --git a/sysdeps/mips/mips64/memcpy.S b/sysdeps/mips/mips64/memcpy.S deleted file mode 100644 index eab9463f86..0000000000 --- a/sysdeps/mips/mips64/memcpy.S +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - Ported to mips3 n32/n64 by Alexandre Oliva <aoliva@redhat.com> - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <endian.h> -#include <sys/asm.h> - - -/* void *memcpy(void *s1, const void *s2, size_t n); - - This could probably be optimized further. */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define LDHI ldl /* high part is left in big-endian */ -# define SDHI sdl /* high part is left in big-endian */ -# define LDLO ldr /* low part is right in big-endian */ -# define SDLO sdr /* low part is right in big-endian */ -#else -# define LDHI ldr /* high part is right in little-endian */ -# define SDHI sdr /* high part is right in little-endian */ -# define LDLO ldl /* low part is left in little-endian */ -# define SDLO sdl /* low part is left in little-endian */ -#endif - -ENTRY (memcpy) - .set noreorder - - slti t0, a2, 16 # Less than 16? - bne t0, zero, L(last16) - move v0, a0 # Setup exit value before too late - - xor t0, a1, a0 # Find a0/a1 displacement - andi t0, 0x7 - bne t0, zero, L(shift) # Go handle the unaligned case - PTR_SUBU t1, zero, a1 - andi t1, 0x7 # a0/a1 are aligned, but are we - beq t1, zero, L(chk8w) # starting in the middle of a word? - PTR_SUBU a2, t1 - LDHI t0, 0(a1) # Yes we are... take care of that - PTR_ADDU a1, t1 - SDHI t0, 0(a0) - PTR_ADDU a0, t1 - -L(chk8w): - andi t0, a2, 0x3f # 64 or more bytes left? - beq t0, a2, L(chk1w) - PTR_SUBU a3, a2, t0 # Yes - PTR_ADDU a3, a1 # a3 = end address of loop - move a2, t0 # a2 = what will be left after loop -L(lop8w): - ld t0, 0(a1) # Loop taking 8 words at a time - ld t1, 8(a1) - ld t2, 16(a1) - ld t3, 24(a1) - ld ta0, 32(a1) - ld ta1, 40(a1) - ld ta2, 48(a1) - ld ta3, 56(a1) - PTR_ADDIU a0, 64 - PTR_ADDIU a1, 64 - sd t0, -64(a0) - sd t1, -56(a0) - sd t2, -48(a0) - sd t3, -40(a0) - sd ta0, -32(a0) - sd ta1, -24(a0) - sd ta2, -16(a0) - bne a1, a3, L(lop8w) - sd ta3, -8(a0) - -L(chk1w): - andi t0, a2, 0x7 # 8 or more bytes left? - beq t0, a2, L(last16) - PTR_SUBU a3, a2, t0 # Yes, handle them one dword at a time - PTR_ADDU a3, a1 # a3 again end address - move a2, t0 -L(lop1w): - ld t0, 0(a1) - PTR_ADDIU a0, 8 - PTR_ADDIU a1, 8 - bne a1, a3, L(lop1w) - sd t0, -8(a0) - -L(last16): - blez a2, L(lst16e) # Handle last 16 bytes, one at a time - PTR_ADDU a3, a2, a1 -L(lst16l): - lb t0, 0(a1) - PTR_ADDIU a0, 1 - PTR_ADDIU a1, 1 - bne a1, a3, L(lst16l) - sb t0, -1(a0) -L(lst16e): - jr ra # Bye, bye - nop - -L(shift): - PTR_SUBU a3, zero, a0 # Src and Dest unaligned - andi a3, 0x7 # (unoptimized case...) - beq a3, zero, L(shft1) - PTR_SUBU a2, a3 # a2 = bytes left - LDHI t0, 0(a1) # Take care of first odd part - LDLO t0, 7(a1) - PTR_ADDU a1, a3 - SDHI t0, 0(a0) - PTR_ADDU a0, a3 -L(shft1): - andi t0, a2, 0x7 - PTR_SUBU a3, a2, t0 - PTR_ADDU a3, a1 -L(shfth): - LDHI t1, 0(a1) # Limp through, dword by dword - LDLO t1, 7(a1) - PTR_ADDIU a0, 8 - PTR_ADDIU a1, 8 - bne a1, a3, L(shfth) - sd t1, -8(a0) - b L(last16) # Handle anything which may be left - move a2, t0 - - .set reorder -END (memcpy) -libc_hidden_builtin_def (memcpy) diff --git a/sysdeps/mips/mips64/memset.S b/sysdeps/mips/mips64/memset.S deleted file mode 100644 index b50aaba816..0000000000 --- a/sysdeps/mips/mips64/memset.S +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. - Ported to mips3 n32/n64 by Alexandre Oliva <aoliva@redhat.com> - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <endian.h> -#include <sys/asm.h> - - -/* void *memset(void *s, int c, size_t n); - - This could probably be optimized further. */ - -#if __BYTE_ORDER == __BIG_ENDIAN -# define SDHI sdl /* high part is left in big-endian */ -#else -# define SDHI sdr /* high part is right in little-endian */ -#endif - -ENTRY (memset) - .set noreorder - - slti ta1, a2, 16 # Less than 16? - bne ta1, zero, L(last16) - move v0, a0 # Setup exit value before too late - - beq a1, zero, L(ueven) # If zero pattern, no need to extend - andi a1, 0xff # Avoid problems with bogus arguments - dsll ta0, a1, 8 - or a1, ta0 - dsll ta0, a1, 16 - or a1, ta0 # a1 is now pattern in full word - dsll ta0, a1, 32 - or a1, ta0 # a1 is now pattern in double word - -L(ueven): - PTR_SUBU ta0, zero, a0 # Unaligned address? - andi ta0, 0x7 - beq ta0, zero, L(chkw) - PTR_SUBU a2, ta0 - SDHI a1, 0(a0) # Yes, handle first unaligned part - PTR_ADDU a0, ta0 # Now both a0 and a2 are updated - -L(chkw): - andi ta0, a2, 0xf # Enough left for one loop iteration? - beq ta0, a2, L(chkl) - PTR_SUBU a3, a2, ta0 - PTR_ADDU a3, a0 # a3 is last loop address +1 - move a2, ta0 # a2 is now # of bytes left after loop -L(loopw): - PTR_ADDIU a0, 16 # Handle 2 dwords pr. iteration - sd a1, -16(a0) - bne a0, a3, L(loopw) - sd a1, -8(a0) - -L(chkl): - andi ta0, a2, 0x8 # Check if there is at least a double - beq ta0, zero, L(last16) # word remaining after the loop - PTR_SUBU a2, ta0 - sd a1, 0(a0) # Yes... - PTR_ADDIU a0, 8 - -L(last16): - blez a2, L(exit) # Handle last 16 bytes (if cnt>0) - PTR_ADDU a3, a2, a0 # a3 is last address +1 -L(lst16l): - PTR_ADDIU a0, 1 - bne a0, a3, L(lst16l) - sb a1, -1(a0) -L(exit): - j ra # Bye, bye - nop - - .set reorder -END (memset) -libc_hidden_builtin_def (memset) diff --git a/sysdeps/mips/mips64/mul_1.S b/sysdeps/mips/mips64/mul_1.S deleted file mode 100644 index c711783001..0000000000 --- a/sysdeps/mips/mips64/mul_1.S +++ /dev/null @@ -1,96 +0,0 @@ -/* MIPS3 __mpn_mul_1 -- Multiply a limb vector with a single limb and - * store the product in a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2000, 2002, 2003 - * Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 4 - .globl __mpn_mul_1 - .ent __mpn_mul_1 -__mpn_mul_1: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): mflo $10 - mfhi $9 - daddiu $5,$5,8 - daddu $10,$10,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$10,$2 # carry from previous addition -> $2 - sd $10,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): mflo $10 - mfhi $9 - daddu $10,$10,$2 - sltu $2,$10,$2 - dmultu $8,$7 - sd $10,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): mflo $10 - mfhi $9 - daddu $10,$10,$2 - sltu $2,$10,$2 - sd $10,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_mul_1 diff --git a/sysdeps/mips/mips64/n32/Implies b/sysdeps/mips/mips64/n32/Implies deleted file mode 100644 index a7cb280ec4..0000000000 --- a/sysdeps/mips/mips64/n32/Implies +++ /dev/null @@ -1,4 +0,0 @@ -ieee754/ldbl-128 -mips/mips64 -mips -wordsize-32 diff --git a/sysdeps/mips/mips64/n32/Makefile b/sysdeps/mips/mips64/n32/Makefile deleted file mode 100644 index a84d2a51bd..0000000000 --- a/sysdeps/mips/mips64/n32/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# `long double' is a distinct type we support. -long-double-fcts = yes - -ifeq ($(filter -mabi=n32,$(CC)),) -CC += -mabi=n32 -endif diff --git a/sysdeps/mips/mips64/n64/Implies b/sysdeps/mips/mips64/n64/Implies deleted file mode 100644 index e507786789..0000000000 --- a/sysdeps/mips/mips64/n64/Implies +++ /dev/null @@ -1,4 +0,0 @@ -ieee754/ldbl-128 -mips/mips64 -mips -wordsize-64 diff --git a/sysdeps/mips/mips64/n64/Makefile b/sysdeps/mips/mips64/n64/Makefile deleted file mode 100644 index a823f32b53..0000000000 --- a/sysdeps/mips/mips64/n64/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# `long double' is a distinct type we support. -long-double-fcts = yes - -ifeq ($(filter -mabi=64,$(CC)),) -CC += -mabi=64 -endif diff --git a/sysdeps/mips/mips64/rshift.S b/sysdeps/mips/mips64/rshift.S deleted file mode 100644 index e6a8a06d3d..0000000000 --- a/sysdeps/mips/mips64/rshift.S +++ /dev/null @@ -1,102 +0,0 @@ -/* MIPS3 __mpn_rshift -- - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * src_ptr $5 - * size $6 - * cnt $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_rshift - .ent __mpn_rshift -__mpn_rshift: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) # load first limb - dsubu $13,$0,$7 - daddiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - dsll $2,$10,$13 # compute function result - - dsubu $6,$6,$9 - -L(Loop0): ld $3,8($5) - daddiu $4,$4,8 - daddiu $5,$5,8 - daddiu $9,$9,-1 - dsrl $11,$10,$7 - dsll $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sd $8,-8($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): ld $3,8($5) - daddiu $4,$4,32 - daddiu $6,$6,-4 - dsrl $11,$10,$7 - dsll $12,$3,$13 - - ld $10,16($5) - dsrl $14,$3,$7 - or $8,$11,$12 - sd $8,-32($4) - dsll $9,$10,$13 - - ld $3,24($5) - dsrl $11,$10,$7 - or $8,$14,$9 - sd $8,-24($4) - dsll $12,$3,$13 - - ld $10,32($5) - dsrl $14,$3,$7 - or $8,$11,$12 - sd $8,-16($4) - dsll $9,$10,$13 - - daddiu $5,$5,32 - or $8,$14,$9 - bgtz $6,L(Loop) - sd $8,-8($4) - -L(Lend): dsrl $8,$10,$7 - j $31 - sd $8,0($4) - .end __mpn_rshift diff --git a/sysdeps/mips/mips64/setjmp.S b/sysdeps/mips/mips64/setjmp.S deleted file mode 100644 index bdfd9cd51c..0000000000 --- a/sysdeps/mips/mips64/setjmp.S +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sgidefs.h> -#include <sysdep.h> -#include <sys/asm.h> - -/* The function __sigsetjmp_aux saves all the registers, but it can't - reliably access the stack or frame pointers, so we pass them in as - extra arguments. */ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__sigsetjmp) -#ifdef __PIC__ - SETUP_GP -#endif - SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp)) - move a2, sp - move a3, fp - PTR_LA t9, __sigsetjmp_aux -#if _MIPS_SIM == _ABIO32 - nop -#endif - RESTORE_GP64 -#if _MIPS_SIM != _ABIO32 - move a4, gp -#endif - jr t9 - .end __sigsetjmp diff --git a/sysdeps/mips/mips64/setjmp_aux.c b/sysdeps/mips/mips64/setjmp_aux.c deleted file mode 100644 index 26b4739c32..0000000000 --- a/sysdeps/mips/mips64/setjmp_aux.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 1996, 1997, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> -#include <sgidefs.h> - -/* This function is only called via the assembly language routine - __sigsetjmp, which arranges to pass in the stack pointer and the frame - pointer. We do things this way because it's difficult to reliably - access them in C. */ - -int -__sigsetjmp_aux (jmp_buf env, int savemask, long long sp, long long fp, - long long gp) -{ - /* Store the floating point callee-saved registers... */ -#if _MIPS_SIM == _ABI64 - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f25, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f27, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f29, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[6])); - asm volatile ("s.d $f31, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[7])); -#else - asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); -#endif - - /* .. and the PC; */ - asm volatile ("sd $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); - - /* .. and the stack pointer; */ - env[0].__jmpbuf[0].__sp = sp; - - /* .. and the FP; it'll be in s8. */ - env[0].__jmpbuf[0].__fp = fp; - - /* .. and the GP; */ - env[0].__jmpbuf[0].__gp = gp; - - /* .. and the callee-saved registers; */ - asm volatile ("sd $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); - asm volatile ("sd $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); - asm volatile ("sd $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); - asm volatile ("sd $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); - asm volatile ("sd $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); - asm volatile ("sd $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); - asm volatile ("sd $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); - asm volatile ("sd $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); - - /* .. and finally get and reconstruct the floating point csr. */ - asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); - - /* Save the signal mask if requested. */ - return __sigjmp_save (env, savemask); -} diff --git a/sysdeps/mips/mips64/soft-fp/sfp-machine.h b/sysdeps/mips/mips64/soft-fp/sfp-machine.h deleted file mode 100644 index 309a14a5f8..0000000000 --- a/sysdeps/mips/mips64/soft-fp/sfp-machine.h +++ /dev/null @@ -1,47 +0,0 @@ -#define _FP_W_TYPE_SIZE 64 -#define _FP_W_TYPE unsigned long long -#define _FP_WS_TYPE signed long long -#define _FP_I_TYPE long long - -#define _FP_MUL_MEAT_S(R,X,Y) \ - _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y) -#define _FP_MUL_MEAT_D(R,X,Y) \ - _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_Q(R,X,Y) \ - _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) - -#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) -#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) -#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y) - -#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) -#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1) -#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1 -#define _FP_NANSIGN_S 0 -#define _FP_NANSIGN_D 0 -#define _FP_NANSIGN_Q 0 - -#define _FP_KEEPNANFRACP 1 -/* From my experiments it seems X is chosen unless one of the - NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ - do { \ - if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ - _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ - { \ - R##_s = _FP_NANSIGN_##fs; \ - _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \ - } \ - else \ - { \ - R##_s = X##_s; \ - _FP_FRAC_COPY_##wc(R,X); \ - } \ - R##_c = FP_CLS_NAN; \ - } while (0) - -#define FP_EX_INVALID (1 << 4) -#define FP_EX_DIVZERO (1 << 3) -#define FP_EX_OVERFLOW (1 << 2) -#define FP_EX_UNDERFLOW (1 << 1) -#define FP_EX_INEXACT (1 << 0) diff --git a/sysdeps/mips/mips64/sub_n.S b/sysdeps/mips/mips64/sub_n.S deleted file mode 100644 index aa8b0dcf9a..0000000000 --- a/sysdeps/mips/mips64/sub_n.S +++ /dev/null @@ -1,130 +0,0 @@ -/* MIPS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and - * store difference in a third limb vector. - * - * Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * s2_ptr $6 - * size $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 2 - .globl __mpn_sub_n - .ent __mpn_sub_n -__mpn_sub_n: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - ld $10,0($5) - ld $11,0($6) - - daddiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,L(L0) # if multiple of 4 limbs, skip first loop - move $2,$0 - - dsubu $7,$7,$9 - -L(Loop0): daddiu $9,$9,-1 - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - or $2,$2,$8 - - daddiu $5,$5,8 - daddiu $6,$6,8 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - daddiu $4,$4,8 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): daddiu $7,$7,-4 - - ld $12,8($5) - daddu $11,$11,$2 - ld $13,8($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - or $2,$2,$8 - - ld $10,16($5) - daddu $13,$13,$2 - ld $11,16($6) - sltu $8,$13,$2 - dsubu $13,$12,$13 - sltu $2,$12,$13 - sd $13,8($4) - or $2,$2,$8 - - ld $12,24($5) - daddu $11,$11,$2 - ld $13,24($6) - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,16($4) - or $2,$2,$8 - - ld $10,32($5) - daddu $13,$13,$2 - ld $11,32($6) - sltu $8,$13,$2 - dsubu $13,$12,$13 - sltu $2,$12,$13 - sd $13,24($4) - or $2,$2,$8 - - daddiu $5,$5,32 - daddiu $6,$6,32 - - bne $7,$0,L(Loop) - daddiu $4,$4,32 - -L(Lend): daddu $11,$11,$2 - sltu $8,$11,$2 - dsubu $11,$10,$11 - sltu $2,$10,$11 - sd $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_sub_n diff --git a/sysdeps/mips/mips64/submul_1.S b/sysdeps/mips/mips64/submul_1.S deleted file mode 100644 index 4971b992a1..0000000000 --- a/sysdeps/mips/mips64/submul_1.S +++ /dev/null @@ -1,108 +0,0 @@ -/* MIPS3 __mpn_submul_1 -- Multiply a limb vector with a single limb and - * subtract the product from a second limb vector. - * - * Copyright (C) 1992, 1994, 1995, 2000, 2002, 2003 - * Free Software Foundation, Inc. - * - * This file is part of the GNU MP Library. - * - * The GNU MP Library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * The GNU MP Library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the GNU MP Library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -#include <sysdep.h> -#include <sys/asm.h> - -/* INPUT PARAMETERS - * res_ptr $4 - * s1_ptr $5 - * size $6 - * s2_limb $7 - */ - -#ifdef __PIC__ - .option pic2 -#endif - .text - .align 4 - .globl __mpn_submul_1 - .ent __mpn_submul_1 -__mpn_submul_1: -#ifdef __PIC__ - SETUP_GP /* ??? unused */ -#endif - .set noreorder - .set nomacro - - # warm up phase 0 - ld $8,0($5) - - # warm up phase 1 - daddiu $5,$5,8 - dmultu $8,$7 - - daddiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 # zero cy2 - - daddiu $6,$6,-1 - beq $6,$0,L(LC1) - ld $8,0($5) # load new s1 limb as early as possible - -L(Loop): ld $10,0($4) - mflo $3 - mfhi $9 - daddiu $5,$5,8 - daddu $3,$3,$2 # add old carry limb to low product limb - dmultu $8,$7 - ld $8,0($5) # load new s1 limb as early as possible - daddiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - bne $6,$0,L(Loop) - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -L(LC1): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dmultu $8,$7 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - daddiu $4,$4,8 - daddu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -L(LC0): ld $10,0($4) - mflo $3 - mfhi $9 - daddu $3,$3,$2 - sltu $2,$3,$2 - dsubu $3,$10,$3 - sgtu $10,$3,$10 - daddu $2,$2,$10 - sd $3,0($4) - j $31 - daddu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_submul_1 diff --git a/sysdeps/mips/mul_1.S b/sysdeps/mips/mul_1.S deleted file mode 100644 index 72f538670c..0000000000 --- a/sysdeps/mips/mul_1.S +++ /dev/null @@ -1,87 +0,0 @@ -/* MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and -store the product in a second limb vector. - -Copyright (C) 1995, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_mul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): mflo $10 - mfhi $9 - addiu $5,$5,4 - addu $10,$10,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$10,$2 /* carry from previous addition -> $2 */ - sw $10,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - multu $8,$7 - sw $10,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - sw $10,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_mul_1) diff --git a/sysdeps/mips/regdef.h b/sysdeps/mips/regdef.h deleted file mode 100644 index bc7f13b4b5..0000000000 --- a/sysdeps/mips/regdef.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _REGDEF_H -#define _REGDEF_H - -#include <sys/regdef.h> -#include <sys/fpregdef.h> - -#endif /* _REGDEF_H */ - diff --git a/sysdeps/mips/rshift.S b/sysdeps/mips/rshift.S deleted file mode 100644 index cb688fe2ac..0000000000 --- a/sysdeps/mips/rshift.S +++ /dev/null @@ -1,95 +0,0 @@ -/* MIPS2 __mpn_rshift -- - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - src_ptr $5 - size $6 - cnt $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_rshift) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) /* load first limb */ - subu $13,$0,$7 - addiu $6,$6,-1 - and $9,$6,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop*/ - sll $2,$10,$13 /* compute function result */ - - subu $6,$6,$9 - -L(Loop0): lw $3,4($5) - addiu $4,$4,4 - addiu $5,$5,4 - addiu $9,$9,-1 - srl $11,$10,$7 - sll $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,L(Loop0) - sw $8,-4($4) - -L(L0): beq $6,$0,L(Lend) - nop - -L(Loop): lw $3,4($5) - addiu $4,$4,16 - addiu $6,$6,-4 - srl $11,$10,$7 - sll $12,$3,$13 - - lw $10,8($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-16($4) - sll $9,$10,$13 - - lw $3,12($5) - srl $11,$10,$7 - or $8,$14,$9 - sw $8,-12($4) - sll $12,$3,$13 - - lw $10,16($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-8($4) - sll $9,$10,$13 - - addiu $5,$5,16 - or $8,$14,$9 - bgtz $6,L(Loop) - sw $8,-4($4) - -L(Lend): srl $8,$10,$7 - j $31 - sw $8,0($4) - END (__mpn_rshift) diff --git a/sysdeps/mips/setjmp.S b/sysdeps/mips/setjmp.S deleted file mode 100644 index 01ef313995..0000000000 --- a/sysdeps/mips/setjmp.S +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -/* The function __sigsetjmp_aux saves all the registers, but it can't - reliably access the stack or frame pointers, so we pass them in as - extra arguments. */ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__sigsetjmp) -#ifdef __PIC__ - .set noreorder - .cpload t9 - .set reorder -#endif - move a2, sp -#ifdef fp - move a3, fp -#else - move a3, $fp -#endif -#ifdef __PIC__ - la t9, __sigsetjmp_aux - jr t9 -#else - j __sigsetjmp_aux -#endif - .end __sigsetjmp diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c deleted file mode 100644 index 7125cc4f81..0000000000 --- a/sysdeps/mips/setjmp_aux.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <setjmp.h> - -/* This function is only called via the assembly language routine - __sigsetjmp, which arranges to pass in the stack pointer and the frame - pointer. We do things this way because it's difficult to reliably - access them in C. */ - -int -__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) -{ - /* Store the floating point callee-saved registers... */ - asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); - asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); - asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); - asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); - asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); - asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); - - /* .. and the PC; */ - asm volatile ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); - - /* .. and the stack pointer; */ - env[0].__jmpbuf[0].__sp = (void *) sp; - - /* .. and the FP; it'll be in s8. */ - env[0].__jmpbuf[0].__fp = (void *) fp; - - /* .. and the GP; */ - asm volatile ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); - - /* .. and the callee-saved registers; */ - asm volatile ("sw $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); - asm volatile ("sw $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); - asm volatile ("sw $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); - asm volatile ("sw $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); - asm volatile ("sw $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); - asm volatile ("sw $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); - asm volatile ("sw $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); - asm volatile ("sw $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); - - /* .. and finally get and reconstruct the floating point csr. */ - asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); - - /* Save the signal mask if requested. */ - return __sigjmp_save (env, savemask); -} diff --git a/sysdeps/mips/sgidefs.h b/sysdeps/mips/sgidefs.h deleted file mode 100644 index 74509fdbd0..0000000000 --- a/sysdeps/mips/sgidefs.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SGIDEFS_H -#define _SGIDEFS_H 1 - -/* - * A crude hack to stop <asm/sgidefs.h> - */ -#undef __ASM_SGIDEFS_H -#define __ASM_SGIDEFS_H - -/* - * And remove any damage it might have already done - */ -#undef _MIPS_ISA_MIPS1 -#undef _MIPS_ISA_MIPS2 -#undef _MIPS_ISA_MIPS3 -#undef _MIPS_ISA_MIPS4 -#undef _MIPS_ISA_MIPS5 -#undef _MIPS_ISA_MIPS32 -#undef _MIPS_ISA_MIPS64 - -#undef _MIPS_SIM_ABI32 -#undef _MIPS_SIM_NABI32 -#undef _MIPS_SIM_ABI64 - -/* - * Definitions for the ISA level - */ -#define _MIPS_ISA_MIPS1 1 -#define _MIPS_ISA_MIPS2 2 -#define _MIPS_ISA_MIPS3 3 -#define _MIPS_ISA_MIPS4 4 -#define _MIPS_ISA_MIPS5 5 -#define _MIPS_ISA_MIPS32 6 -#define _MIPS_ISA_MIPS64 7 - -/* - * Subprogram calling convention - */ -#ifndef _ABIO32 -# define _ABIO32 1 -#endif -#define _MIPS_SIM_ABI32 _ABIO32 - -#ifndef _ABIN32 -# define _ABIN32 2 -#endif -#define _MIPS_SIM_NABI32 _ABIN32 - -#ifndef _ABI64 -# define _ABI64 3 -#endif -#define _MIPS_SIM_ABI64 _ABI64 - -#endif /* sgidefs.h */ diff --git a/sysdeps/mips/soft-fp/sfp-machine.h b/sysdeps/mips/soft-fp/sfp-machine.h deleted file mode 100644 index 3b2a40f0e2..0000000000 --- a/sysdeps/mips/soft-fp/sfp-machine.h +++ /dev/null @@ -1,47 +0,0 @@ -#define _FP_W_TYPE_SIZE 32 -#define _FP_W_TYPE unsigned long -#define _FP_WS_TYPE signed long -#define _FP_I_TYPE long - -#define _FP_MUL_MEAT_S(R,X,Y) \ - _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_D(R,X,Y) \ - _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) -#define _FP_MUL_MEAT_Q(R,X,Y) \ - _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) - -#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y) -#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) -#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) - -#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) -#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 -#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 -#define _FP_NANSIGN_S 0 -#define _FP_NANSIGN_D 0 -#define _FP_NANSIGN_Q 0 - -#define _FP_KEEPNANFRACP 1 -/* From my experiments it seems X is chosen unless one of the - NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ - do { \ - if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ - _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ - { \ - R##_s = _FP_NANSIGN_##fs; \ - _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \ - } \ - else \ - { \ - R##_s = X##_s; \ - _FP_FRAC_COPY_##wc(R,X); \ - } \ - R##_c = FP_CLS_NAN; \ - } while (0) - -#define FP_EX_INVALID (1 << 4) -#define FP_EX_DIVZERO (1 << 3) -#define FP_EX_OVERFLOW (1 << 2) -#define FP_EX_UNDERFLOW (1 << 1) -#define FP_EX_INEXACT (1 << 0) diff --git a/sysdeps/mips/stackinfo.h b/sysdeps/mips/stackinfo.h deleted file mode 100644 index 86e3d621ba..0000000000 --- a/sysdeps/mips/stackinfo.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -/* On MIPS the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -#endif /* stackinfo.h */ diff --git a/sysdeps/mips/sub_n.S b/sysdeps/mips/sub_n.S deleted file mode 100644 index 53fa019343..0000000000 --- a/sysdeps/mips/sub_n.S +++ /dev/null @@ -1,122 +0,0 @@ -/* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and -store difference in a third limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - s2_ptr $6 - size $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_sub_n) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 /* number of limbs in first loop */ - beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */ - move $2,$0 - - subu $7,$7,$9 - -L(Loop0): addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,L(Loop0) - addiu $4,$4,4 - -L(L0): beq $7,$0,L(Lend) - nop - -L(Loop): addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,L(Loop) - addiu $4,$4,16 - -L(Lend): addu $11,$11,$2 - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - j $31 - or $2,$2,$8 - END (__mpn_sub_n) diff --git a/sysdeps/mips/submul_1.S b/sysdeps/mips/submul_1.S deleted file mode 100644 index 4c8a612650..0000000000 --- a/sysdeps/mips/submul_1.S +++ /dev/null @@ -1,99 +0,0 @@ -/* MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and -subtract the product from a second limb vector. - -Copyright (C) 1995, 2000, 2002, 2003 Free Software Foundation, Inc. - -This file is part of the GNU MP Library. - -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -The GNU MP Library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with the GNU MP Library; see the file COPYING.LIB. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. */ - -#include <sysdep.h> - -/* INPUT PARAMETERS - res_ptr $4 - s1_ptr $5 - size $6 - s2_limb $7 -*/ -#ifdef __PIC__ - .option pic2 -#endif -ENTRY (__mpn_submul_1) - .set noreorder -#ifdef __PIC__ - .cpload t9 -#endif - .set nomacro - - /* warm up phase 0 */ - lw $8,0($5) - - /* warm up phase 1 */ - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,L(LC0) - move $2,$0 /* zero cy2 */ - - addiu $6,$6,-1 - beq $6,$0,L(LC1) - lw $8,0($5) /* load new s1 limb as early as possible */ - -L(Loop): lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 /* add old carry limb to low product limb */ - multu $8,$7 - lw $8,0($5) /* load new s1 limb as early as possible */ - addiu $6,$6,-1 /* decrement loop counter */ - sltu $2,$3,$2 /* carry from previous addition -> $2 */ - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,L(Loop) /* should be "bnel" */ - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 1 */ -L(LC1): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 /* add high product limb and carry from addition */ - - /* cool down phase 0 */ -L(LC0): lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 /* add high product limb and carry from addition */ - END (__mpn_submul_1) diff --git a/sysdeps/mips/sys/asm.h b/sysdeps/mips/sys/asm.h deleted file mode 100644 index b590802fd9..0000000000 --- a/sysdeps/mips/sys/asm.h +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (C) 1997, 1998, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_ASM_H -#define _SYS_ASM_H - -#include <sgidefs.h> - -#ifndef CAT -# ifdef __STDC__ -# define __CAT(str1,str2) str1##str2 -# else -# define __CAT(str1,str2) str1/**/str2 -# endif -# define CAT(str1,str2) __CAT(str1,str2) -#endif - -/* - * Macros to handle different pointer/register sizes for 32/64-bit code - * - * 64 bit address space isn't used yet, so we may use the R3000 32 bit - * defines for now. - */ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 -# define PTR .word -# define PTRSIZE 4 -# define PTRLOG 2 -#elif _MIPS_SIM == _ABI64 -# define PTR .dword -# define PTRSIZE 8 -# define PTRLOG 3 -#endif - -/* - * PIC specific declarations - */ -#if _MIPS_SIM == _ABIO32 -# ifdef __PIC__ -# define CPRESTORE(register) \ - .cprestore register -# define CPLOAD(register) \ - .cpload register -# else -# define CPRESTORE(register) -# define CPLOAD(register) -# endif - -# define CPADD(register) \ - .cpadd register - -/* - * Set gp when at 1st instruction - */ -# define SETUP_GP \ - .set noreorder; \ - .cpload $25; \ - .set reorder -/* Set gp when not at 1st instruction */ -# define SETUP_GPX(r) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal 10f; /* Find addr of cpload. */ \ - nop; \ -10: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SETUP_GPX_L(r, l) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal l; /* Find addr of cpload. */ \ - nop; \ -l: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SAVE_GP(x) \ - .cprestore x /* Save gp trigger t9/jalr conversion. */ -# define SETUP_GP64(a, b) -# define SETUP_GPX64(a, b) -# define SETUP_GPX64_L(cp_reg, ra_save, l) -# define RESTORE_GP64 -# define USE_ALT_CP(a) -#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */ -/* - * For callee-saved gp calling convention: - */ -# define SETUP_GP -# define SETUP_GPX(r) -# define SETUP_GPX_L(r, l) -# define SAVE_GP(x) - -# define SETUP_GP64(gpoffset, proc) \ - .cpsetup $25, gpoffset, proc -# define SETUP_GPX64(cp_reg, ra_save) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal 10f; /* Find addr of .cpsetup. */ \ - nop; \ -10: \ - .set reorder; \ - .cpsetup $31, cp_reg, 10b; \ - move $31, ra_save -# define SETUP_GPX64_L(cp_reg, ra_save, l) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal l; /* Find addr of .cpsetup. */ \ - nop; \ -l: \ - .set reorder; \ - .cpsetup $31, cp_reg, l; \ - move $31, ra_save -# define RESTORE_GP64 \ - .cpreturn -/* Use alternate register for context pointer. */ -# define USE_ALT_CP(reg) \ - .cplocal reg -#endif /* _MIPS_SIM != _ABIO32 */ - -/* - * Stack Frame Definitions - */ -#if _MIPS_SIM == _ABIO32 -# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */ -#endif -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define NARGSAVE 0 /* No caller responsibilities. */ -#endif - - -/* - * LEAF - declare leaf routine - */ -#define LEAF(symbol) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp,0,ra - -/* - * NESTED - declare nested routine entry point - */ -#define NESTED(symbol, framesize, rpc) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp, framesize, rpc - -/* - * END - mark end of function - */ -#ifndef END -# define END(function) \ - .end function; \ - .size function,.-function -#endif - -/* - * EXPORT - export definition of symbol - */ -#define EXPORT(symbol) \ - .globl symbol; \ -symbol: - -/* - * ABS - export absolute symbol - */ -#define ABS(symbol,value) \ - .globl symbol; \ -symbol = value - -#define PANIC(msg) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal panic; \ -9: b 9b; \ - .set pop; \ - TEXT(msg) - -/* - * Print formated string - */ -#define PRINT(string) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal printk; \ - .set pop; \ - TEXT(string) - -#define TEXT(msg) \ - .data; \ -8: .asciiz msg; \ - .previous; - -/* - * Build text tables - */ -#define TTABLE(string) \ - .text; \ - .word 1f; \ - .previous; \ - .data; \ -1: .asciz string; \ - .previous - -/* - * MIPS IV pref instruction. - * Use with .set noreorder only! - * - * MIPS IV implementations are free to treat this as a nop. The R5000 - * is one of them. So we should have an option not to use this instruction. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define PREF(hint,addr) \ - pref hint,addr -# define PREFX(hint,addr) \ - prefx hint,addr -#else -# define PREF -# define PREFX -#endif - -/* - * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. - */ -#if _MIPS_ISA == _MIPS_ISA_MIPS1 -# define MOVN(rd,rs,rt) \ - .set push; \ - .set reorder; \ - beqz rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set reorder; \ - bnez rt,9f; \ - move rd,rt; \ - .set pop; \ -9: -#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) -# define MOVN(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - bnezl rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - beqzl rt,9f; \ - movz rd,rs; \ - .set pop; \ -9: -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MOVN(rd,rs,rt) \ - movn rd,rs,rt -# define MOVZ(rd,rs,rt) \ - movz rd,rs,rt -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */ - -/* - * Stack alignment - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define ALSZ 15 -# define ALMASK ~15 -#else -# define ALSZ 7 -# define ALMASK ~7 -#endif - -/* - * Size of a register - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define SZREG 8 -#else -# define SZREG 4 -#endif - -/* - * Use the following macros in assemblercode to load/store registers, - * pointers etc. - */ -#if (SZREG == 4) -# define REG_S sw -# define REG_L lw -#else -# define REG_S sd -# define REG_L ld -#endif - -/* - * How to add/sub/load/store/shift C int variables. - */ -#if (_MIPS_SZINT == 32) -# define INT_ADD add -# define INT_ADDI addi -# define INT_ADDU addu -# define INT_ADDIU addiu -# define INT_SUB add -# define INT_SUBI subi -# define INT_SUBU subu -# define INT_SUBIU subu -# define INT_L lw -# define INT_S sw -#endif - -#if (_MIPS_SZINT == 64) -# define INT_ADD dadd -# define INT_ADDI daddi -# define INT_ADDU daddu -# define INT_ADDIU daddiu -# define INT_SUB dadd -# define INT_SUBI dsubi -# define INT_SUBU dsubu -# define INT_SUBIU dsubu -# define INT_L ld -# define INT_S sd -#endif - -/* - * How to add/sub/load/store/shift C long variables. - */ -#if (_MIPS_SZLONG == 32) -# define LONG_ADD add -# define LONG_ADDI addi -# define LONG_ADDU addu -# define LONG_ADDIU addiu -# define LONG_SUB add -# define LONG_SUBI subi -# define LONG_SUBU subu -# define LONG_SUBIU subu -# define LONG_L lw -# define LONG_S sw -# define LONG_SLL sll -# define LONG_SLLV sllv -# define LONG_SRL srl -# define LONG_SRLV srlv -# define LONG_SRA sra -# define LONG_SRAV srav -#endif - -#if (_MIPS_SZLONG == 64) -# define LONG_ADD dadd -# define LONG_ADDI daddi -# define LONG_ADDU daddu -# define LONG_ADDIU daddiu -# define LONG_SUB dadd -# define LONG_SUBI dsubi -# define LONG_SUBU dsubu -# define LONG_SUBIU dsubu -# define LONG_L ld -# define LONG_S sd -# define LONG_SLL dsll -# define LONG_SLLV dsllv -# define LONG_SRL dsrl -# define LONG_SRLV dsrlv -# define LONG_SRA dsra -# define LONG_SRAV dsrav -#endif - -/* - * How to add/sub/load/store/shift pointers. - */ -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32) -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUB add -# define PTR_SUBI subi -# define PTR_SUBU subu -# define PTR_SUBIU subu -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU add /* no u */ -# define PTR_ADDIU addi /* no u */ -# define PTR_SUB add -# define PTR_SUBI subi -# define PTR_SUBU sub /* no u */ -# define PTR_SUBIU sub /* no u */ -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \ - || _MIPS_SIM == _ABI64 -# define PTR_ADD dadd -# define PTR_ADDI daddi -# define PTR_ADDU daddu -# define PTR_ADDIU daddiu -# define PTR_SUB dadd -# define PTR_SUBI dsubi -# define PTR_SUBU dsubu -# define PTR_SUBIU dsubu -# define PTR_L ld -# define PTR_LA dla -# define PTR_S sd -# define PTR_SLL dsll -# define PTR_SLLV dsllv -# define PTR_SRL dsrl -# define PTR_SRLV dsrlv -# define PTR_SRA dsra -# define PTR_SRAV dsrav - -# define PTR_SCALESHIFT 3 -#endif - -/* - * Some cp0 registers were extended to 64bit for MIPS III. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS32) -# define MFC0 mfc0 -# define MTC0 mtc0 -#endif -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \ - (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MFC0 dmfc0 -# define MTC0 dmtc0 -#endif - -/* The MIPS archtectures do not have a uniform memory model. Particular - platforms may provide additional guarantees - for instance, the R4000 - LL and SC instructions implicitly perform a SYNC, and the 4K promises - strong ordering. - - However, in the absence of those guarantees, we must assume weak ordering - and SYNC explicitly where necessary. - - Some obsolete MIPS processors may not support the SYNC instruction. This - applies to "true" MIPS I processors; most of the processors which compile - using MIPS I implement parts of MIPS II. */ - -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#endif /* sys/asm.h */ diff --git a/sysdeps/mips/sys/fpregdef.h b/sysdeps/mips/sys/fpregdef.h deleted file mode 100644 index 378115274f..0000000000 --- a/sysdeps/mips/sys/fpregdef.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_FPREGDEF_H -#define _SYS_FPREGDEF_H - -/* - * These definitions only cover the R3000-ish 16/32 register model. - * But we're trying to be R3000 friendly anyway ... - */ -#define fv0 $f0 /* return value */ -#define fv0f $f1 -#define fv1 $f2 -#define fv1f $f3 -#define fa0 $f12 /* argument registers */ -#define fa0f $f13 -#define fa1 $f14 -#define fa1f $f15 -#define ft0 $f4 /* caller saved */ -#define ft0f $f5 -#define ft1 $f6 -#define ft1f $f7 -#define ft2 $f8 -#define ft2f $f9 -#define ft3 $f10 -#define ft3f $f11 -#define ft4 $f16 -#define ft4f $f17 -#define ft5 $f18 -#define ft5f $f19 -#define fs0 $f20 /* callee saved */ -#define fs0f $f21 -#define fs1 $f22 -#define fs1f $f23 -#define fs2 $f24 -#define fs2f $f25 -#define fs3 $f26 -#define fs3f $f27 -#define fs4 $f28 -#define fs4f $f29 -#define fs5 $f30 -#define fs5f $f31 - -#define fcr31 $31 /* FPU status register */ - -#endif /* sys/fpregdef.h */ diff --git a/sysdeps/mips/sys/regdef.h b/sysdeps/mips/sys/regdef.h deleted file mode 100644 index 8fb898a2d0..0000000000 --- a/sysdeps/mips/sys/regdef.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (C) 1997, 1998, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_REGDEF_H -#define _SYS_REGDEF_H - -#include <sgidefs.h> - -/* - * Symbolic register names for 32 bit ABI - */ -#define zero $0 /* wired zero */ -#define AT $1 /* assembler temp - uppercase because of ".set at" */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#if _MIPS_SIM != _ABIO32 -#define a4 $8 -#define a5 $9 -#define a6 $10 -#define a7 $11 -#define t0 $12 -#define t1 $13 -#define t2 $14 -#define t3 $15 -#define ta0 a4 -#define ta1 a5 -#define ta2 a6 -#define ta3 a7 -#else /* if _MIPS_SIM == _ABIO32 */ -#define t0 $8 /* caller saved */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define ta0 t4 -#define ta1 t5 -#define ta2 t6 -#define ta3 t7 -#endif /* _MIPS_SIM == _ABIO32 */ -#define s0 $16 /* callee saved */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* caller saved */ -#define t9 $25 -#define jp $25 /* PIC jump register */ -#define k0 $26 /* kernel scratch */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define fp $30 /* frame pointer */ -#define s8 $30 /* same like fp! */ -#define ra $31 /* return address */ - -#endif /* _SYS_REGDEF_H */ diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h deleted file mode 100644 index fe378e94cd..0000000000 --- a/sysdeps/mips/sys/ucontext.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* System V/mips ABI compliant context switching support. */ - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <sgidefs.h> -#include <signal.h> - -/* Type for general register. */ -#if _MIPS_SIM == _ABIO32 -typedef __uint32_t greg_t; -#else -typedef __uint64_t greg_t; -#endif - -/* Number of general registers. */ -#define NGREG 36 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Number of each register is the `gregset_t' array. */ -enum -{ - CTX_R0 = 0, -#define CTX_R0 CTX_R0 - CTX_AT = 1, -#define CTX_AT CTX_AT - CTX_V0 = 2, -#define CTX_V0 CTX_V0 - CTX_V1 = 3, -#define CTX_V1 CTX_V1 - CTX_A0 = 4, -#define CTX_A0 CTX_A0 - CTX_A1 = 5, -#define CTX_A1 CTX_A1 - CTX_A2 = 6, -#define CTX_A2 CTX_A2 - CTX_A3 = 7, -#define CTX_A3 CTX_A3 - CTX_T0 = 8, -#define CTX_T0 CTX_T0 - CTX_T1 = 9, -#define CTX_T1 CTX_T1 - CTX_T2 = 10, -#define CTX_T2 CTX_T2 - CTX_T3 = 11, -#define CTX_T3 CTX_T3 - CTX_T4 = 12, -#define CTX_T4 CTX_T4 - CTX_T5 = 13, -#define CTX_T5 CTX_T5 - CTX_T6 = 14, -#define CTX_T6 CTX_T6 - CTX_T7 = 15, -#define CTX_T7 CTX_T7 - CTX_S0 = 16, -#define CTX_S0 CTX_S0 - CTX_S1 = 17, -#define CTX_S1 CTX_S1 - CTX_S2 = 18, -#define CTX_S2 CTX_S2 - CTX_S3 = 19, -#define CTX_S3 CTX_S3 - CTX_S4 = 20, -#define CTX_S4 CTX_S4 - CTX_S5 = 21, -#define CTX_S5 CTX_S5 - CTX_S6 = 22, -#define CTX_S6 CTX_S6 - CTX_S7 = 23, -#define CTX_S7 CTX_S7 - CTX_T8 = 24, -#define CTX_T8 CTX_T8 - CTX_T9 = 25, -#define CTX_T9 CTX_T9 - CTX_K0 = 26, -#define CTX_K0 CTX_K0 - CTX_K1 = 27, -#define CTX_K1 CTX_K1 - CTX_GP = 28, -#define CTX_GP CTX_GP - CTX_SP = 29, -#define CTX_SP CTX_SP - CTX_S8 = 30, -#define CTX_S8 CTX_S8 - CTX_RA = 31, -#define CTX_RA CTX_RA - CTX_MDLO = 32, -#define CTX_MDLO CTX_MDLO - CTX_MDHI = 33, -#define CTX_MDHI CTX_MDHI - CTX_CAUSE = 34, -#define CTX_CAUSE CTX_CAUSE - CTX_EPC = 35, -#define CTX_EPC CTX_EPC -}; - -/* Structure to describe FPU registers. */ -typedef struct fpregset -{ - union - { -#if _MIPS_SIM == _ABIO32 - double fp_dregs[16]; - float fp_fregs[32]; - unsigned int fp_regs[32]; -#else - double fp_dregs[32]; - /* float fp_fregs[32]; */ - __uint64_t fp_regs[32]; -#endif - } fp_r; - unsigned int fp_csr; - unsigned int fp_pad; -} fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct -{ - gregset_t gpregs; - fpregset_t fpregs; -} mcontext_t; - -/* Userlevel context. */ -typedef struct ucontext -{ -#if _MIPS_SIM == _ABIO32 - unsigned long int uc_flags; -#else - __uint64_t uc_flags; -#endif - struct ucontext *uc_link; - __sigset_t uc_sigmask; - stack_t uc_stack; - mcontext_t uc_mcontext; - int uc_filler[48]; -} ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/mips/tls-macros.h b/sysdeps/mips/tls-macros.h deleted file mode 100644 index 2d0516b3e4..0000000000 --- a/sysdeps/mips/tls-macros.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Macros to support TLS testing in times of missing compiler support. */ - -#if _MIPS_SIM != _ABI64 - -/* These versions are for o32 and n32. */ - -# define TLS_GD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("addiu %0, $28, %%tlsgd(" #x ")" \ - : "=r" (__result)); \ - (int *)__tls_get_addr (__result); }) -#else -# define TLS_GD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("daddiu %0, $28, %%tlsgd(" #x ")" \ - : "=r" (__result)); \ - (int *)__tls_get_addr (__result); }) -#endif - -#if _MIPS_SIM != _ABI64 -# define TLS_LD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("addiu %0, $28, %%tlsldm(" #x ")" \ - : "=r" (__result)); \ - __result = __tls_get_addr (__result); \ - asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \ - "addiu $3,$3,%%dtprel_lo(" #x ")\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_IE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lw $3,%%gottprel(" #x ")($28)\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_LE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lui $3,%%tprel_hi(" #x ")\n\t" \ - "addiu $3,$3,%%tprel_lo(" #x ")\n\t" \ - "addu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) - -#else - -/* These versions are for n64. */ - -# define TLS_LD(x) \ - ({ void *__result; \ - extern void *__tls_get_addr (void *); \ - asm ("daddiu %0, $28, %%tlsldm(" #x ")" \ - : "=r" (__result)); \ - __result = __tls_get_addr (__result); \ - asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \ - "daddiu $3,$3,%%dtprel_lo(" #x ")\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_IE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("ld $3,%%gottprel(" #x ")($28)\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -# define TLS_LE(x) \ - ({ void *__result; \ - asm (".set push\n\t.set mips32r2\n\t" \ - "rdhwr\t%0,$29\n\t.set pop" \ - : "=v" (__result)); \ - asm ("lui $3,%%tprel_hi(" #x ")\n\t" \ - "daddiu $3,$3,%%tprel_lo(" #x ")\n\t" \ - "daddu %0,%0,$3" \ - : "+r" (__result) : : "$3"); \ - __result; }) -#endif diff --git a/sysdeps/unix/mips/brk.S b/sysdeps/unix/mips/brk.S deleted file mode 100644 index a35b8b9113..0000000000 --- a/sysdeps/unix/mips/brk.S +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#include <sys/asm.h> - -#ifndef SYS_brk -#define SYS_brk 17 -#endif - -#ifndef HAVE_GNU_LD -#define _end end -#endif - - .data -ENTRY(__curbrk) - .word 0 - .end __curbrk - - .text -SYSCALL__(brk, 1) - .set reorder - /* Handle the query case. */ - bnez a0, 1f - move a0, v0 -1: /* Update __curbrk and exit cleanly. */ - PTR_S a0, __curbrk - move v0, zero - jr ra -PSEUDO_END(__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/mips/dl-brk.S b/sysdeps/unix/mips/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/mips/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include <brk.S> diff --git a/sysdeps/unix/mips/fork.S b/sysdeps/unix/mips/fork.S deleted file mode 100644 index a7848acb6b..0000000000 --- a/sysdeps/unix/mips/fork.S +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -SYSCALL__ (fork, 0) - beq v1, zero, parent /* Branch if parent. */ - nop - /* We are the child. Return zero. */ - move v0, zero -parent: - ret -PSEUDO_END(__fork) - -libc_hidden_def (__fork) -weak_alias (__fork, fork) diff --git a/sysdeps/unix/mips/mips32/sysdep.h b/sysdeps/unix/mips/mips32/sysdep.h deleted file mode 100644 index 0b5d1186bb..0000000000 --- a/sysdeps/unix/mips/mips32/sysdep.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdeps/unix/mips/sysdep.h> - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99: la t9,__syscall_error; \ - jr t9; \ - ENTRY(name) \ - .set noreorder; \ - .cpload t9; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - nop; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif diff --git a/sysdeps/unix/mips/mips64/n32/sysdep.h b/sysdeps/unix/mips/mips64/n32/sysdep.h deleted file mode 100644 index ec93fadc04..0000000000 --- a/sysdeps/unix/mips/mips64/n32/sysdep.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdeps/unix/mips/sysdep.h> - -#ifdef __ASSEMBLER__ - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99:; \ - .set noat; \ - .cpsetup t9, $1, name; \ - .set at; \ - la t9,__syscall_error; \ - .cpreturn; \ - jr t9; \ - ENTRY(name) \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif - -#endif diff --git a/sysdeps/unix/mips/mips64/n64/sysdep.h b/sysdeps/unix/mips/mips64/n64/sysdep.h deleted file mode 100644 index 502b66797b..0000000000 --- a/sysdeps/unix/mips/mips64/n64/sysdep.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdeps/unix/mips/sysdep.h> - -#ifdef __ASSEMBLER__ - -/* Note that while it's better structurally, going back to call __syscall_error - can make things confusing if you're debugging---it looks like it's jumping - backwards into the previous fn. */ -#ifdef __PIC__ -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99:; \ - .set noat; \ - .cpsetup t9, $1, name; \ - .set at; \ - dla t9,__syscall_error; \ - .cpreturn; \ - jr t9; \ - ENTRY(name) \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - bne a3, zero, 99b; \ -L(syse1): -#else -#define PSEUDO(name, syscall_name, args) \ - .set noreorder; \ - .align 2; \ - 99: j __syscall_error; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall; \ - .set reorder; \ - bne a3, zero, 99b; \ -L(syse1): -#endif - -#endif diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S deleted file mode 100644 index ee7b76d635..0000000000 --- a/sysdeps/unix/mips/pipe.S +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -SYSCALL__ (pipe, 1) - /* Plop in the two descriptors. */ - sw v0, 0(a0) - sw v1, 4(a0) - - /* Go out with a clean status. */ - move v0, zero - j ra -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/mips/rt-sysdep.S b/sysdeps/unix/mips/rt-sysdep.S deleted file mode 100644 index f966bf1e59..0000000000 --- a/sysdeps/unix/mips/rt-sysdep.S +++ /dev/null @@ -1 +0,0 @@ -#include <sysdep.S> diff --git a/sysdeps/unix/mips/sigreturn.S b/sysdeps/unix/mips/sigreturn.S deleted file mode 100644 index 2cb3adb6de..0000000000 --- a/sysdeps/unix/mips/sigreturn.S +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -#ifndef SYS_sigreturn -#define SYS_sigreturn 103 -#endif - -ENTRY(__sigreturn) - li v0, SYS_sigreturn - syscall - .end __sigreturn - -weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S deleted file mode 100644 index 8c172db190..0000000000 --- a/sysdeps/unix/mips/sysdep.S +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> -#define _ERRNO_H -#include <bits/errno.h> -#include <sys/asm.h> - -#ifdef _LIBC_REENTRANT - -LOCALSZ= 3 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -RAOFF= FRAMESZ-(1*SZREG) -GPOFF= FRAMESZ-(2*SZREG) -V0OFF= FRAMESZ-(3*SZREG) - -ENTRY(__syscall_error) -#ifdef __PIC__ - .set noat - SETUP_GPX (AT) - .set at -#endif - PTR_SUBU sp, FRAMESZ - .set noat - SETUP_GPX64(GPOFF,AT) - .set at -#ifdef __PIC__ - SAVE_GP(GPOFF) -#endif - REG_S v0, V0OFF(sp) - REG_S ra, RAOFF(sp) - -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ - bne v0, EWOULDBLOCK_sys, L(skip) - nop - li v0, EAGAIN -L(skip): -#endif - /* Find our per-thread errno address */ - jal __errno_location - - /* Store the error value. */ - REG_L t0, V0OFF(sp) - sw t0, 0(v0) - - /* And just kick back a -1. */ - REG_L ra, RAOFF(sp) - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - li v0, -1 - j ra - END(__syscall_error) - -#else /* _LIBC_REENTRANT */ - - -ENTRY(__syscall_error) -#ifdef __PIC__ - SETUP_GPX (AT) -#endif - SETUP_GPX64 (t9, AT) - -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ - bne v0, EWOULDBLOCK_sys, L(skip) - li v0, EAGAIN -L(skip): -#endif - /* Store it in errno... */ - sw v0, errno - - /* And just kick back a -1. */ - li v0, -1 - - RESTORE_GP64 - j ra - END(__syscall_error) -#endif /* _LIBC_REENTRANT */ diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h deleted file mode 100644 index 714830147d..0000000000 --- a/sysdeps/unix/mips/sysdep.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sgidefs.h> -#include <sysdeps/unix/sysdep.h> - -#ifdef __ASSEMBLER__ - -#include <regdef.h> - -#define ENTRY(name) \ - .globl name; \ - .align 2; \ - .ent name,0; \ - name##: - -#undef END -#define END(function) \ - .end function; \ - .size function,.-function - -#define ret j ra ; nop - -#undef PSEUDO_END -#define PSEUDO_END(sym) .end sym; .size sym,.-sym - -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - .align 2; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall - -#undef PSEUDO_END_NOERRNO -#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym - -#define ret_NOERRNO ret - -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - .align 2; \ - ENTRY(name) \ - .set noreorder; \ - li v0, SYS_ify(syscall_name); \ - syscall - -#undef PSEUDO_END_ERRVAL -#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym - -#define ret_ERRVAL ret - -#define r0 v0 -#define r1 v1 -/* The mips move insn is d,s. */ -#define MOVE(x,y) move y , x - -#if _MIPS_SIM == _ABIO32 -# define L(label) $L ## label -#else -# define L(label) .L ## label -#endif - -#endif diff --git a/sysdeps/unix/mips/wait.S b/sysdeps/unix/mips/wait.S deleted file mode 100644 index de0f6ebfae..0000000000 --- a/sysdeps/unix/mips/wait.S +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1992, 1994, 1995, 1997, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -.set noreorder - -ENTRY(__wait) - /* Prep it for wait. */ - move a1, zero - move a2, zero - - li v0, SYS_wait - syscall - beqz a3, L(noerror) - nop - j __syscall_error - nop - -L(noerror): - /* If the arg is not NULL, store v1 there. */ - beqz a0, L(noarg) - nop - sw v1, 0(a0) - nop -L(noarg): - ret - .end __wait - -weak_alias (__wait, wait) diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 837a1c14fb..888819a455 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -21,10 +21,6 @@ /* This file must not contain any C code. At least it must be protected to allow using the file also in assembler files. */ -#if defined __mips__ -# include <sgidefs.h> -#endif - #ifndef __LINUX_KERNEL_VERSION /* We assume the worst; all kernels should be supported. */ # define __LINUX_KERNEL_VERSION 0 @@ -133,7 +129,7 @@ /* Linux 2.3.39 introduced 32bit UID/GIDs. Some platforms had 32 bit type all along. */ -#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__ +#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ # define __ASSUME_32BITUIDS 1 #endif @@ -151,11 +147,6 @@ # define __ASSUME_IPC64 1 #endif -/* MIPS platforms had IPC64 all along. */ -#if defined __mips__ -# define __ASSUME_IPC64 1 -#endif - /* We can use the LDTs for threading with Linux 2.3.99 and newer. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_LDT_WORKS 1 @@ -292,10 +283,6 @@ # define __ASSUME_TIMEVAL64 1 #endif -#if defined __mips__ && _MIPS_SIM == _ABIN32 -# define __ASSUME_FCNTL64 1 -#endif - /* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize their availability with one define. The changes were made first for i386 and the have to be done separately for the other archs. diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile deleted file mode 100644 index 72fa87b3ff..0000000000 --- a/sysdeps/unix/sysv/linux/mips/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -ifeq ($(subdir),signal) -#sysdep_routines += sigsuspend -endif - -ifeq ($(subdir),misc) -sysdep_routines += cachectl cacheflush sysmips _test_and_set - -sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h - -no_syscall_list_h = 1 - -# A callable macro that expands to a shell command. Preprocess file $(1) -# using ABI option $(2) and see which macros it defines. Print FOO for each -# macro of the form __NR$(3)_FOO, filtering out ABI-specific __NR macros -# that have a prefix other than $(3). -mips_list_syscalls = $(filter-out -m%,$(CC)) -E -x c $(+includes) \ - $(sysincludes) -D_LIBC -dM -mabi=$(2) $(1) | \ - sed -n 's@^\#define __NR$(3)_\([^ ]*\) .*@\1@p' | \ - sed -e '/^[ON]32_/d' -e '/^N64_/d' -e '/^64_/d' | \ - LC_ALL=C sort - -# Generate a list of SYS_* macros from the linux __NR macros. -# -# Before version 2.6, linux had separate 32-bit and 64-bit MIPS ports, -# each with its own set of headers. The ports were merged for 2.6 and -# this merged port defines the syscalls in a slightly different way. -# There are therefore three sets of headers that we need to consider: -# -# (1) Headers from the separate 32-bit MIPS port. They just define -# a single list of __NR macros. -# -# (2) Headers from the separate 64-bit MIPS port. They unconditionally -# define syscalls for all three ABIs, with o32 syscalls prefixed -# by __NR_O32, n32 syscalls prefixed by __NR_N32 and n64 syscalls -# prefixed by plain __NR. -# -# (3) Headers from the combined port. They use the _MIPS_SIM macro to -# define the right set of syscalls for the current ABI. The syscalls -# themselves have no special ABI prefix, but the headers also define: -# -# __NR_O32_Linux{,_syscalls} -# __NR_N32_Linux{,_syscalls} -# __NR_64_Linux{,_syscalls} -# -# In case (1) we just want a simple list of SYS_* macros. In cases (2) -# and (3) we want a file that will work for all three ABIs, regardless -# of which ABI we are currently using. We also want the file to work -# if the user later moves from (2) to (3). Thus the file we create -# for (2) and (3) has the form: -# -# #if _MIPS_SIM == _ABIN32 -# # ifdef __NR_N32_open -# # define SYS_n32syscall1 __NR_N32_n32syscall1 -# # ... -# # else -# # define SYS_n32syscall1 __NR_n32syscall1 -# # ... -# # endif -# #elif _MIPS_SIM == _ABI64 -# # define SYS_n64syscall1 __NR_n64syscall1 -# # ... -# #else -# # ifdef __NR_O32_open -# # define SYS_o32syscall1 __NR_O32_o32syscall1 -# # ... -# # else -# # define SYS_o32syscall1 __NR_o32syscall1 -# # ... -# # endif -# #endif -# -# Here, __NR_N32_open and __NR_O32_open are used to detect case (2) -# over case (3). The n64 SYS_* macros can always use the normal -# ABI-less names. -$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/mips/sys/syscall.h - $(make-target-directory) - $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC $< -MD -MP \ - -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' > /dev/null - { \ - echo '/* Generated at libc build time from kernel syscall list. */';\ - echo ''; \ - echo '#ifndef _SYSCALL_H'; \ - echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \ - echo '#endif'; \ - echo ''; \ - echo '#include <sgidefs.h>'; \ - rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ - $(call mips_list_syscalls,$<,n32,_N32) > $(@:.d=.h).newn32; \ - if test -s $(@:.d=.h).newn32; then \ - if grep open $(@:.d=.h).newn32 > /dev/null; then \ - $(call mips_list_syscalls,$<,32,_O32) > $(@:.d=.h).new32; \ - $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ - else \ - $(call mips_list_syscalls,$<,32,) > $(@:.d=.h).new32; \ - $(call mips_list_syscalls,$<,n32,) > $(@:.d=.h).newn32; \ - $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ - fi; \ - echo '#if _MIPS_SIM == _ABIN32'; \ - echo '# ifdef __NR_N32_open'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_N32_\1@' < $(@:.d=.h).newn32; \ - echo '# else'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).newn32; \ - echo '# endif'; \ - echo '#elif _MIPS_SIM == _ABI64'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new64; \ - echo '#else'; \ - echo '# ifdef __NR_O32_open'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_O32_\1@' < $(@:.d=.h).new32; \ - echo '# else'; \ - sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new32; \ - echo '# endif'; \ - echo '#endif'; \ - else \ - $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC -dM $< | \ - sed -n 's@^\#define __NR_\([^ ]*\) .*@\#define SYS_\1 __NR_\1@p' | \ - LC_ALL=C sort; \ - fi; \ - rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ - } > $(@:.d=.h).new - mv -f $(@:.d=.h).new $(@:.d=.h) -ifneq (,$(objpfx)) - sed $(sed-remove-objpfx) $(@:.h=.d)-t > $(@:.h=.d)-t2 - rm -f $(@:.h=.d)-t - mv -f $(@:.h=.d)-t2 $(@:.h=.d) -else - mv -f $(@:.h=.d)-t $(@:.h=.d) -endif -endif diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions deleted file mode 100644 index 50bfac5599..0000000000 --- a/sysdeps/unix/sysv/linux/mips/Versions +++ /dev/null @@ -1,31 +0,0 @@ -libc { - # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk. - # When you get an error from errlist-compat.awk, you need to add a new - # version here. Don't do this blindly, since this means changing the ABI - # for all GNU/Linux configurations. - - GLIBC_2.0 { - #errlist-compat 123 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - - # Exception handling support functions from libgcc - __register_frame; __register_frame_table; __deregister_frame; - __frame_state_for; __register_frame_info_table; - - # Needed by gcc: - _flush_cache; - - # c* - cachectl; cacheflush; - - # s* - sysmips; - } - GLIBC_2.2 { - #errlist-compat 1134 - _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; - - # _* - _test_and_set; - } -} diff --git a/sysdeps/unix/sysv/linux/mips/_test_and_set.c b/sysdeps/unix/sysv/linux/mips/_test_and_set.c deleted file mode 100644 index 9fd48f753e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/_test_and_set.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Define the real-function versions of all inline functions - defined in sys/tas.h */ - -#include <features.h> - -#define _EXTERN_INLINE -#ifndef __USE_EXTERN_INLINES -# define __USE_EXTERN_INLINES 1 -#endif - -#include "sys/tas.h" diff --git a/sysdeps/unix/sysv/linux/mips/bits/endian.h b/sysdeps/unix/sysv/linux/mips/bits/endian.h deleted file mode 100644 index 0a3d2fabe3..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/endian.h +++ /dev/null @@ -1,16 +0,0 @@ -/* The MIPS architecture has selectable endianness. - Linux/MIPS exists in two both little and big endian flavours and we - want to be able to share the installed headerfiles between both, - so we define __BYTE_ORDER based on GCC's predefines. */ - -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." -#endif - -#ifdef __MIPSEB__ -# define __BYTE_ORDER __BIG_ENDIAN -#else -# ifdef __MIPSEL__ -# define __BYTE_ORDER __LITTLE_ENDIAN -# endif -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/errno.h b/sysdeps/unix/sysv/linux/mips/bits/errno.h deleted file mode 100644 index 5ff11c0e77..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/errno.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Error constants. MIPS/Linux specific version. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifdef _ERRNO_H - -# undef EDOM -# undef EILSEQ -# undef ERANGE -# include <linux/errno.h> - -/* Linux has no ENOTSUP error code. */ -# define ENOTSUP EOPNOTSUPP - -# ifndef ECANCELED -# define ECANCELED 158 -# endif - -/* Support for error codes to support robust mutexes was added later, too. */ -# ifndef EOWNERDEAD -# define EOWNERDEAD 165 -# define ENOTRECOVERABLE 166 -# endif - -# ifndef __ASSEMBLER__ -/* Function to get address of global `errno' variable. */ -extern int *__errno_location (void) __THROW __attribute__ ((__const__)); - -# if !defined _LIBC || defined _LIBC_REENTRANT -/* When using threads, errno is a per-thread value. */ -# define errno (*__errno_location ()) -# endif -# endif /* !__ASSEMBLER__ */ -#endif /* _ERRNO_H */ - -#if !defined _ERRNO_H && defined __need_Emath -/* This is ugly but the kernel header is not clean enough. We must - define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is - defined. */ -# define EDOM 33 /* Math argument out of domain of function. */ -# define EILSEQ 88 /* Illegal byte sequence. */ -# define ERANGE 34 /* Math result not representable. */ -#endif /* !_ERRNO_H && __need_Emath */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h deleted file mode 100644 index aa039b4c0e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h +++ /dev/null @@ -1,194 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FCNTL_H -# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." -#endif - -#include <sgidefs.h> -#include <sys/types.h> - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0x0003 -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_APPEND 0x0008 -#define O_SYNC 0x0010 -#define O_NONBLOCK 0x0080 -#define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ -#define O_EXCL 0x0400 /* not fcntl */ -#define O_NOCTTY 0x0800 /* not fcntl */ -#define O_FSYNC O_SYNC -#define O_ASYNC 0x1000 - -#ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 0x2000 /* Allow large file opens. */ -#endif - -#ifdef __USE_GNU -# define O_NOFOLLOW 0x20000 /* Do not follow links. */ -# define O_DIRECT 0x8000 /* Direct disk access hint. */ -# define O_DIRECTORY 0x10000 /* Must be a directory. */ -# define O_NOATIME 0x40000 /* Do not set atime. */ -#endif - -#define O_NDELAY O_NONBLOCK - -/* For now Linux has no synchronisity options for data and read - operations. We define the symbols here but let them do the same as - O_SYNC since this is a superset. */ -#if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ -# define O_RSYNC O_SYNC /* Synchronize read operations. */ -#endif - -/* Values for the second argument to `fcntl'. */ -#define F_DUPFD 0 /* Duplicate file descriptor. */ -#define F_GETFD 1 /* Get file descriptor flags. */ -#define F_SETFD 2 /* Set file descriptor flags. */ -#define F_GETFL 3 /* Get file status flags. */ -#define F_SETFL 4 /* Set file status flags. */ -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 14 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ -#endif - -#define F_GETLK64 33 /* Get record locking info. */ -#define F_SETLK64 34 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 35 /* Set record locking info (blocking). */ - -#if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 24 /* Get owner of socket (receiver of SIGIO). */ -# define F_GETOWN 23 /* Set owner of socket (receiver of SIGIO). */ -#endif - -#ifdef __USE_GNU -# define F_SETSIG 10 /* Set number of signal to be sent. */ -# define F_GETSIG 11 /* Get number of signal to be sent. */ -#endif - -#ifdef __USE_GNU -# define F_SETLEASE 1024 /* Set a lease. */ -# define F_GETLEASE 1025 /* Enquire what lease is active. */ -# define F_NOTIFY 1026 /* Request notfications on a directory. */ -#endif - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ -#define F_RDLCK 0 /* Read lock. */ -#define F_WRLCK 1 /* Write lock. */ -#define F_UNLCK 2 /* Remove lock. */ - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -#ifdef __USE_BSD -/* Operations for bsd flock(), also used by the kernel implementation */ -# define LOCK_SH 1 /* shared lock */ -# define LOCK_EX 2 /* exclusive lock */ -# define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -# define LOCK_UN 8 /* remove lock */ -#endif - -#ifdef __USE_GNU -# define LOCK_MAND 32 /* This is a mandatory flock: */ -# define LOCK_READ 64 /* ... which allows concurrent read operations. */ -# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ -# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ -#endif - -#ifdef __USE_GNU -/* Types of directory notifications that may be requested with F_NOTIFY. */ -# define DN_ACCESS 0x00000001 /* File accessed. */ -# define DN_MODIFY 0x00000002 /* File modified. */ -# define DN_CREATE 0x00000004 /* File created. */ -# define DN_DELETE 0x00000008 /* File removed. */ -# define DN_RENAME 0x00000010 /* File renamed. */ -# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ -# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ -#endif - -typedef struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ -#ifndef __USE_FILE_OFFSET64 - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ -#if _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - fcntls in o32 and n32, never has this field. */ - long int l_sysid; -#endif -#else - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ -#endif - __pid_t l_pid; /* Process holding the lock. */ -#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - flock in o32 and n32, never has this field. */ - long int pad[4]; -#endif -} flock_t; - -#ifdef __USE_LARGEFILE64 -struct flock64 - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ - __pid_t l_pid; /* Process holding the lock. */ - }; -#endif - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -# define FAPPEND O_APPEND -# define FFSYNC O_FSYNC -# define FASYNC O_ASYNC -# define FNONBLOCK O_NONBLOCK -# define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -/* Advise to `posix_fadvise'. */ -#ifdef __USE_XOPEN2K -# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ -# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h deleted file mode 100644 index a8dcf242d3..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Structure types for pre-termios terminal ioctls. Linux/MIPS version. - Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_IOCTL_H -# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." -#endif - -/* Get definition of constants for use with `ioctl'. */ -#include <asm/ioctls.h> - -struct winsize - { - unsigned short int ws_row; - unsigned short int ws_col; - unsigned short int ws_xpixel; - unsigned short int ws_ypixel; - }; - -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - char c_line; /* line discipline */ - /* Yes, this is really NCCS. */ - unsigned char c_cc[32 /* NCCS */]; /* control characters */ - }; - -/* modem lines */ -#define TIOCM_LE 0x001 /* line enable */ -#define TIOCM_DTR 0x002 /* data terminal ready */ -#define TIOCM_RTS 0x004 /* request to send */ -#define TIOCM_ST 0x010 /* secondary transmit */ -#define TIOCM_SR 0x020 /* secondary receive */ -#define TIOCM_CTS 0x040 /* clear to send */ -#define TIOCM_CAR 0x100 /* carrier detect */ -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RNG 0x200 /* ring */ -#define TIOCM_RI TIOCM_RNG -#define TIOCM_DSR 0x400 /* data set ready */ - -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 /* X.25 async */ -#define N_6PACK 7 -#define N_MASC 8 /* Mobitex module */ -#define N_R3964 9 /* Simatic R3964 module */ -#define N_PROFIBUS_FDL 10 /* Profibus */ -#define N_IRDA 11 /* Linux IR */ -#define N_SMSBLOCK 12 /* SMS block mode */ -#define N_HDLC 13 /* synchronous HDLC */ -#define N_SYNC_PPP 14 /* synchronous PPP */ -#define N_HCI 15 /* Bluetooth HCI UART */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/sysdeps/unix/sysv/linux/mips/bits/ipc.h deleted file mode 100644 index 1f629ce665..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/ipc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_IPC_H -# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." -#endif - -#include <bits/types.h> - -/* Mode bits for `msgget', `semget', and `shmget'. */ -#define IPC_CREAT 01000 /* Create key if key does not exist. */ -#define IPC_EXCL 02000 /* Fail if key exists. */ -#define IPC_NOWAIT 04000 /* Return error on wait. */ - -/* Control commands for `msgctl', `semctl', and `shmctl'. */ -#define IPC_RMID 0 /* Remove identifier. */ -#define IPC_SET 1 /* Set `ipc_perm' options. */ -#define IPC_STAT 2 /* Get `ipc_perm' options. */ -#ifdef __USE_GNU -# define IPC_INFO 3 /* See ipcs. */ -#endif - -/* Special key values. */ -#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ - - -/* Data structure used to pass permission information to IPC operations. */ -struct ipc_perm - { - __key_t __key; /* Key. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ - unsigned short int __pad1; - unsigned long int __unused1; - unsigned long int __unused2; -}; diff --git a/sysdeps/unix/sysv/linux/mips/bits/mman.h b/sysdeps/unix/sysv/linux/mips/bits/mman.h deleted file mode 100644 index e287e3b378..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/mman.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux/MIPS version. - Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_MMAN_H -# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." -#endif - -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. */ - - -/* Protections are chosen from these bits, OR'd together. The - implementation does not necessarily support PROT_EXEC or PROT_WRITE - without PROT_READ. The only guarantees are that no writing will be - allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ - -#define PROT_READ 0x1 /* Page can be read. */ -#define PROT_WRITE 0x2 /* Page can be written. */ -#define PROT_EXEC 0x4 /* Page can be executed. */ -#define PROT_NONE 0x0 /* Page can not be accessed. */ -#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of - growsdown vma (mprotect only). */ -#define PROT_GROWSUP 0x02000000 /* Extend change to start of - growsup vma (mprotect only). */ - -/* Sharing types (must choose one and only one of these). */ -#define MAP_SHARED 0x01 /* Share changes. */ -#define MAP_PRIVATE 0x02 /* Changes are private. */ -#ifdef __USE_MISC -# define MAP_TYPE 0x0f /* Mask for type of mapping. */ -#endif - -/* Other flags. */ -#define MAP_FIXED 0x10 /* Interpret addr exactly. */ -#ifdef __USE_MISC -# define MAP_FILE 0x00 -# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */ -# define MAP_ANON MAP_ANONYMOUS -# define MAP_RENAME MAP_ANONYMOUS -#endif - -/* These are Linux-specific. */ -#ifdef __USE_MISC -# define MAP_NORESERVE 0x0400 /* don't check for reservations */ -# define MAP_ANONYMOUS 0x0800 /* don't use a file */ -# define MAP_GROWSDOWN 0x1000 /* stack-like segment */ -# define MAP_DENYWRITE 0x2000 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */ -# define MAP_LOCKED 0x8000 /* pages are locked */ -# define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ -# define MAP_NONBLOCK 0x20000 /* do not block on IO */ -#endif - -/* Flags to `msync'. */ -#define MS_ASYNC 1 /* Sync memory asynchronously. */ -#define MS_INVALIDATE 2 /* Invalidate the caches. */ -#define MS_SYNC 4 /* Synchronous memory sync. */ - -/* Flags for `mlockall'. */ -#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ -#define MCL_FUTURE 2 /* Lock all additions to address - space. */ - -/* Advice to `madvise'. */ -#ifdef __USE_BSD -#define MADV_NORMAL 0 /* default page-in behavior */ -#define MADV_RANDOM 1 /* page-in minimum required */ -#define MADV_SEQUENTIAL 2 /* read-ahead aggressively */ -#define MADV_WILLNEED 3 /* pre-fault pages */ -#define MADV_DONTNEED 4 /* discard these pages */ -#define MADV_REMOVE 5 /* remove these pages & resources */ -#endif - -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/msq.h b/sysdeps/unix/sysv/linux/mips/bits/msq.h deleted file mode 100644 index c2c1dd2e85..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/msq.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_MSG_H -# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." -#endif - -#include <bits/types.h> - -/* Define options for message queue functions. */ -#define MSG_NOERROR 010000 /* no error if message is too big */ -#ifdef __USE_GNU -# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ -#endif - -/* Types used in the structure definition. */ -typedef unsigned long int msgqnum_t; -typedef unsigned long int msglen_t; - - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ - __time_t msg_stime; /* time of last msgsnd command */ - __time_t msg_rtime; /* time of last msgrcv command */ - __time_t msg_ctime; /* time of last change */ - unsigned long int __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -#ifdef __USE_MISC - -# define msg_cbytes __msg_cbytes - -/* ipcs ctl commands */ -# define MSG_STAT 11 -# define MSG_INFO 12 - -/* buffer for msgctl calls IPC_INFO, MSG_INFO */ -struct msginfo - { - int msgpool; - int msgmap; - int msgmax; - int msgmnb; - int msgmni; - int msgssz; - int msgtql; - unsigned short int msgseg; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h deleted file mode 100644 index f62b9c3948..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/poll.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_POLL_H -# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." -#endif - -/* Event types that can be polled for. These bits may be set in `events' - to indicate the interesting event types; they will appear in `revents' - to indicate the status of the file descriptor. */ -#define POLLIN 0x001 /* There is data to read. */ -#define POLLPRI 0x002 /* There is urgent data to read. */ -#define POLLOUT 0x004 /* Writing now will not block. */ - -#ifdef __USE_XOPEN -/* These values are defined in XPG4.2. */ -# define POLLRDNORM 0x040 /* Normal data may be read. */ -# define POLLRDBAND 0x080 /* Priority data may be read. */ -# define POLLWRNORM POLLOUT /* Writing now will not block. */ -# define POLLWRBAND 0x100 /* Priority data may be written. */ -#endif - -#ifdef __USE_GNU -/* This is an extension for Linux. */ -# define POLLMSG 0x400 -#endif - -/* Event types always implicitly polled for. These bits need not be set in - `events', but they will appear in `revents' to indicate the status of - the file descriptor. */ -#define POLLERR 0x008 /* Error condition. */ -#define POLLHUP 0x010 /* Hung up. */ -#define POLLNVAL 0x020 /* Invalid polling request. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h deleted file mode 100644 index 7e7152935b..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/resource.h +++ /dev/null @@ -1,225 +0,0 @@ -/* Bit values & structures for resource limits. Linux/MIPS version. - Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_RESOURCE_H -# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." -#endif - -#include <bits/types.h> - -/* Transmute defines to enumerations. The macro re-definitions are - necessary because some programs want to test for operating system - features with #ifdef RUSAGE_SELF. In ISO C the reflexive - definition is a no-op. */ - -/* Kinds of resource limit. */ -enum __rlimit_resource -{ - /* Per-process CPU limit, in seconds. */ - RLIMIT_CPU = 0, -#define RLIMIT_CPU RLIMIT_CPU - - /* Largest file that can be created, in bytes. */ - RLIMIT_FSIZE = 1, -#define RLIMIT_FSIZE RLIMIT_FSIZE - - /* Maximum size of data segment, in bytes. */ - RLIMIT_DATA = 2, -#define RLIMIT_DATA RLIMIT_DATA - - /* Maximum size of stack segment, in bytes. */ - RLIMIT_STACK = 3, -#define RLIMIT_STACK RLIMIT_STACK - - /* Largest core file that can be created, in bytes. */ - RLIMIT_CORE = 4, -#define RLIMIT_CORE RLIMIT_CORE - - /* Largest resident set size, in bytes. - This affects swapping; processes that are exceeding their - resident set size will be more likely to have physical memory - taken from them. */ - __RLIMIT_RSS = 7, -#define RLIMIT_RSS __RLIMIT_RSS - - /* Number of open files. */ - RLIMIT_NOFILE = 5, - __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ -#define RLIMIT_NOFILE RLIMIT_NOFILE -#define RLIMIT_OFILE __RLIMIT_OFILE - - /* Address space limit (?) */ - RLIMIT_AS = 6, -#define RLIMIT_AS RLIMIT_AS - - /* Number of processes. */ - __RLIMIT_NPROC = 8, -#define RLIMIT_NPROC __RLIMIT_NPROC - - /* Locked-in-memory address space. */ - __RLIMIT_MEMLOCK = 9, -#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK - - /* Maximum number of file locks. */ - __RLIMIT_LOCKS = 10, -#define RLIMIT_LOCKS __RLIMIT_LOCKS - - /* Maximum number of pending signals. */ - __RLIMIT_SIGPENDING = 11, -#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING - - /* Maximum bytes in POSIX message queues. */ - __RLIMIT_MSGQUEUE = 12, -#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE - - /* Maximum nice priority allowed to raise to. - Nice levels 19 .. -20 correspond to 0 .. 39 - values of this resource limit. */ - __RLIMIT_NICE = 13, -#define RLIMIT_NICE __RLIMIT_NICE - - /* Maximum realtime priority allowed for non-priviledged - processes. */ - __RLIMIT_RTPRIO = 14, -#define RLIMIT_RTPRIO _RLIMIT_RTPRIO - - __RLIMIT_NLIMITS = 15, - __RLIM_NLIMITS = __RLIMIT_NLIMITS -#define RLIMIT_NLIMITS __RLIMIT_NLIMITS -#define RLIM_NLIMITS __RLIM_NLIMITS -}; - -/* Value to indicate that there is no limit. */ -#ifndef __USE_FILE_OFFSET64 -# define RLIM_INFINITY ((long int)(~0UL >> 1)) -#else -# define RLIM_INFINITY 0x7fffffffffffffffLL -#endif - -#ifdef __USE_LARGEFILE64 -# define RLIM64_INFINITY 0x7fffffffffffffffLL -#endif - -/* We can represent all limits. */ -#define RLIM_SAVED_MAX RLIM_INFINITY -#define RLIM_SAVED_CUR RLIM_INFINITY - - -/* Type for resource quantity measurement. */ -#ifndef __USE_FILE_OFFSET64 -typedef __rlim_t rlim_t; -#else -typedef __rlim64_t rlim_t; -#endif -#ifdef __USE_LARGEFILE64 -typedef __rlim64_t rlim64_t; -#endif - -struct rlimit - { - /* The current (soft) limit. */ - rlim_t rlim_cur; - /* The hard limit. */ - rlim_t rlim_max; - }; - -#ifdef __USE_LARGEFILE64 -struct rlimit64 - { - /* The current (soft) limit. */ - rlim64_t rlim_cur; - /* The hard limit. */ - rlim64_t rlim_max; - }; -#endif - -/* Whose usage statistics do you want? */ -enum __rusage_who -{ - /* The calling process. */ - RUSAGE_SELF = 0, -#define RUSAGE_SELF RUSAGE_SELF - - /* All of its terminated child processes. */ - RUSAGE_CHILDREN = -1 -#define RUSAGE_CHILDREN RUSAGE_CHILDREN -}; - -#define __need_timeval -#include <bits/time.h> /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage - { - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; - }; - -/* Priority limits. */ -#define PRIO_MIN -20 /* Minimum priority a process can have. */ -#define PRIO_MAX 20 /* Maximum priority a process can have. */ - -/* The type of the WHICH argument to `getpriority' and `setpriority', - indicating what flavor of entity the WHO argument specifies. */ -enum __priority_which -{ - PRIO_PROCESS = 0, /* WHO is a process ID. */ -#define PRIO_PROCESS PRIO_PROCESS - PRIO_PGRP = 1, /* WHO is a process group ID. */ -#define PRIO_PGRP PRIO_PGRP - PRIO_USER = 2 /* WHO is a user ID. */ -#define PRIO_USER PRIO_USER -}; diff --git a/sysdeps/unix/sysv/linux/mips/bits/sem.h b/sysdeps/unix/sysv/linux/mips/bits/sem.h deleted file mode 100644 index 6282de9cc8..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sem.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_SEM_H -# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." -#endif - -#include <sys/types.h> - -/* Flags for `semop'. */ -#define SEM_UNDO 0x1000 /* undo the operation on exit */ - -/* Commands for `semctl'. */ -#define GETPID 11 /* get sempid */ -#define GETVAL 12 /* get semval */ -#define GETALL 13 /* get all semval's */ -#define GETNCNT 14 /* get semncnt */ -#define GETZCNT 15 /* get semzcnt */ -#define SETVAL 16 /* set semval */ -#define SETALL 17 /* set all semval's */ - - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __time_t sem_otime; /* last semop() time */ - __time_t sem_ctime; /* last time changed by semctl() */ - unsigned long int sem_nsems; /* number of semaphores in set */ - unsigned long int __unused1; - unsigned long int __unused2; -}; - -/* The user should define a union like the following to use it for arguments - for `semctl'. - - union semun - { - int val; <= value for SETVAL - struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET - unsigned short int *array; <= array for GETALL & SETALL - struct seminfo *__buf; <= buffer for IPC_INFO - }; - - Previous versions of this file used to define this union but this is - incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether - one must define the union or not. */ -#define _SEM_SEMUN_UNDEFINED 1 - -#ifdef __USE_MISC - -/* ipcs ctl cmds */ -# define SEM_STAT 18 -# define SEM_INFO 19 - -struct seminfo -{ - int semmap; - int semmni; - int semmns; - int semmnu; - int semmsl; - int semopm; - int semume; - int semusz; - int semvmx; - int semaem; -}; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h deleted file mode 100644 index b3083346dd..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/shm.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_SHM_H -# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." -#endif - -#include <bits/types.h> - -/* Permission flag for shmget. */ -#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ -#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ - -/* Flags for `shmat'. */ -#define SHM_RDONLY 010000 /* attach read-only else read-write */ -#define SHM_RND 020000 /* round attach address to SHMLBA */ -#define SHM_REMAP 040000 /* take-over region on attach */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - -/* Segment low boundary address multiple. */ -#define SHMLBA 0x40000 - - -/* Type to count number of attaches. */ -typedef unsigned long int shmatt_t; - -/* Data structure describing a set of semaphores. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __time_t shm_atime; /* time of last shmat() */ - __time_t shm_dtime; /* time of last shmdt() */ - __time_t shm_ctime; /* time of last change by shmctl() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - unsigned long int __unused1; - unsigned long int __unused2; - }; - -#ifdef __USE_MISC - -/* ipcs ctl commands */ -# define SHM_STAT 13 -# define SHM_INFO 14 - -/* shm_mode upper byte flags */ -# define SHM_DEST 01000 /* segment will be destroyed on last detach */ -# define SHM_LOCKED 02000 /* segment will not be swapped */ -# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ - -struct shminfo - { - unsigned long int shmmax; - unsigned long int shmmin; - unsigned long int shmmni; - unsigned long int shmseg; - unsigned long int shmall; - unsigned long int __unused1; - unsigned long int __unused2; - unsigned long int __unused3; - unsigned long int __unused4; - }; - -struct shm_info - { - int used_ids; - unsigned long int shm_tot; /* total allocated shm */ - unsigned long int shm_rss; /* total resident shm */ - unsigned long int shm_swp; /* total swapped shm */ - unsigned long int swap_attempts; - unsigned long int swap_successes; - }; - -#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h deleted file mode 100644 index d04e25f76f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h +++ /dev/null @@ -1,89 +0,0 @@ -/* The proper definitions for Linux/MIPS's sigaction. - Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SIGNAL_H -# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." -#endif - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Special flags. */ - unsigned int sa_flags; - - /* Signal handler. */ -#ifdef __USE_POSIX199309 - union - { - /* Used if SA_SIGINFO is not set. */ - __sighandler_t sa_handler; - /* Used if SA_SIGINFO is set. */ - void (*sa_sigaction) (int, siginfo_t *, void *); - } - __sigaction_handler; -# define sa_handler __sigaction_handler.sa_handler -# define sa_sigaction __sigaction_handler.sa_sigaction -#else - __sighandler_t sa_handler; -#endif - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* The ABI says here are two unused ints following. */ - /* Restore handler. */ - void (*sa_restorer) (void); - -#if _MIPS_SZPTR < 64 - int sa_resv[1]; -#endif - }; - -/* Bits in `sa_flags'. */ -/* Please note that some Linux kernels versions use different values for these - flags which is a bug in those kernel versions. */ -#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ -#define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ -#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with - three arguments instead of one. */ -#if defined __USE_UNIX98 || defined __USE_MISC -# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ -# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ -# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ -# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when - its handler is being executed. */ -#endif -#ifdef __USE_MISC -# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ - -/* Some aliases for the SA_ constants. */ -# define SA_NOMASK SA_NODEFER -# define SA_ONESHOT SA_RESETHAND -# define SA_STACK SA_ONSTACK -#endif - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_NOP 0 /* 0 is unused to catch errors */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ -#ifdef __USE_MISC -# define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: - set only the low 32 bit of the sigset. */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h deleted file mode 100644 index 079964ed46..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H -# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." -#endif - -#include <sgidefs.h> - -#ifndef sigcontext_struct -/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ -# define sigcontext_struct sigcontext - -/* # include <asm/sigcontext.h> */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste the - contents here. In case you're wondering about the different - licenses, the fact that the file is pasted, instead of included, - doesn't really make any difference for the program that includes - this header. */ -#if _MIPS_SIM == _ABIO32 -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 2000 by Ralf Baechle - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ -struct sigcontext { - unsigned int sc_regmask; /* Unused */ - unsigned int sc_status; - unsigned long long sc_pc; - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned int sc_ownedfp; /* Unused */ - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; /* Unused */ - unsigned int sc_used_math; - unsigned int sc_ssflags; /* Unused */ - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - - unsigned int sc_cause; /* Unused */ - unsigned int sc_badvaddr; /* Unused */ - - unsigned long sc_sigset[4]; /* kernel's sigset_t */ -}; - -#endif /* _ASM_SIGCONTEXT_H */ -#else /* _MIPS_SIM != _ABIO32 */ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 1999 by Ralf Baechle - * Copyright (C) 1999 Silicon Graphics, Inc. - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ -struct sigcontext { - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - unsigned long long sc_pc; - unsigned int sc_status; - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; - unsigned int sc_used_math; - unsigned int sc_cause; - unsigned int sc_badvaddr; -}; - -#endif /* _ASM_SIGCONTEXT_H */ -#endif /* _MIPS_SIM != _ABIO32 */ -#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/sysdeps/unix/sysv/linux/mips/bits/siginfo.h deleted file mode 100644 index 787e365139..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h +++ /dev/null @@ -1,310 +0,0 @@ -/* siginfo_t, sigevent and constants. Linux/MIPS version. - Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#if !defined _SIGNAL_H && !defined __need_siginfo_t \ - && !defined __need_sigevent_t -# error "Never include this file directly. Use <signal.h> instead" -#endif - -#include <bits/wordsize.h> - -#if (!defined __have_sigval_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t \ - || defined __need_sigevent_t)) -# define __have_sigval_t 1 - -/* Type for data associated with a signal. */ -typedef union sigval - { - int sival_int; - void *sival_ptr; - } sigval_t; -#endif - -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 - -# define __SI_MAX_SIZE 128 -# if __WORDSIZE == 64 -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) -# else -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) -# endif - - -typedef struct siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Signal code. */ - int si_errno; /* If non-zero, an errno value associated with - this signal, as defined in <errno.h>. */ - int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3]; - /* Explicit padding. */ - - union - { - int _pad[__SI_PAD_SIZE]; - - /* kill(). */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - } _kill; - - /* SIGCHLD. */ - struct - { - __pid_t si_pid; /* Which child. */ - __uid_t si_uid; /* Real user ID of sending process. */ - int si_status; /* Exit value or signal. */ - __clock_t si_utime; - __clock_t si_stime; - } _sigchld; - - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ - struct - { - void *si_addr; /* Faulting insn/memory ref. */ - } _sigfault; - - /* SIGPOLL. */ - struct - { - int si_band; /* Band event for SIGPOLL. */ - int si_fd; - } _sigpoll; - - /* POSIX.1b timers. */ - struct - { - unsigned int _timer1; - unsigned int _timer2; - } _timer; - - /* POSIX.1b signals. */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - sigval_t si_sigval; /* Signal value. */ - } _rt; - } _sifields; - } siginfo_t; - - -/* X/Open requires some more fields with fixed names. */ -# define si_pid _sifields._kill.si_pid -# define si_uid _sifields._kill.si_uid -# define si_status _sifields._sigchld.si_status -# define si_utime _sifields._sigchld.si_utime -# define si_stime _sifields._sigchld.si_stime -# define si_value _sifields._rt.si_sigval -# define si_int _sifields._rt.si_sigval.sival_int -# define si_ptr _sifields._rt.si_sigval.sival_ptr -# define si_addr _sifields._sigfault.si_addr -# define si_band _sifields._sigpoll.si_band -# define si_fd _sifields._sigpoll.si_fd - - -/* Values for `si_code'. Positive values are reserved for kernel-generated - signals. */ -enum -{ - SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ -# define SI_ASYNCNL SI_ASYNCNL - SI_TKILL = -6, /* Sent by tkill. */ -# define SI_TKILL SI_TKILL - SI_SIGIO, /* Sent by queued SIGIO. */ -# define SI_SIGIO SI_SIGIO - SI_MESGQ, /* Sent by real time mesq state change. */ -# define SI_MESGQ SI_MESGQ - SI_TIMER, /* Sent by real time mesq state change. */ -# define SI_TIMER SI_TIMER - SI_ASYNCIO, /* Sent by AIO completion. */ -# define SI_ASYNCIO SI_ASYNCIO - SI_QUEUE, /* Sent by sigqueue. */ -# define SI_QUEUE SI_QUEUE - SI_USER, /* Sent by kill, sigsend, raise. */ -# define SI_USER SI_USER - SI_KERNEL = 0x80 /* Send by kernel. */ -#define SI_KERNEL SI_KERNEL -}; - - -/* `si_code' values for SIGILL signal. */ -enum -{ - ILL_ILLOPC = 1, /* Illegal opcode. */ -# define ILL_ILLOPC ILL_ILLOPC - ILL_ILLOPN, /* Illegal operand. */ -# define ILL_ILLOPN ILL_ILLOPN - ILL_ILLADR, /* Illegal addressing mode. */ -# define ILL_ILLADR ILL_ILLADR - ILL_ILLTRP, /* Illegal trap. */ -# define ILL_ILLTRP ILL_ILLTRP - ILL_PRVOPC, /* Privileged opcode. */ -# define ILL_PRVOPC ILL_PRVOPC - ILL_PRVREG, /* Privileged register. */ -# define ILL_PRVREG ILL_PRVREG - ILL_COPROC, /* Coprocessor error. */ -# define ILL_COPROC ILL_COPROC - ILL_BADSTK /* Internal stack error. */ -# define ILL_BADSTK ILL_BADSTK -}; - -/* `si_code' values for SIGFPE signal. */ -enum -{ - FPE_INTDIV = 1, /* Integer divide by zero. */ -# define FPE_INTDIV FPE_INTDIV - FPE_INTOVF, /* Integer overflow. */ -# define FPE_INTOVF FPE_INTOVF - FPE_FLTDIV, /* Floating point divide by zero. */ -# define FPE_FLTDIV FPE_FLTDIV - FPE_FLTOVF, /* Floating point overflow. */ -# define FPE_FLTOVF FPE_FLTOVF - FPE_FLTUND, /* Floating point underflow. */ -# define FPE_FLTUND FPE_FLTUND - FPE_FLTRES, /* Floating point inexact result. */ -# define FPE_FLTRES FPE_FLTRES - FPE_FLTINV, /* Floating point invalid operation. */ -# define FPE_FLTINV FPE_FLTINV - FPE_FLTSUB /* Subscript out of range. */ -# define FPE_FLTSUB FPE_FLTSUB -}; - -/* `si_code' values for SIGSEGV signal. */ -enum -{ - SEGV_MAPERR = 1, /* Address not mapped to object. */ -# define SEGV_MAPERR SEGV_MAPERR - SEGV_ACCERR /* Invalid permissions for mapped object. */ -# define SEGV_ACCERR SEGV_ACCERR -}; - -/* `si_code' values for SIGBUS signal. */ -enum -{ - BUS_ADRALN = 1, /* Invalid address alignment. */ -# define BUS_ADRALN BUS_ADRALN - BUS_ADRERR, /* Non-existant physical address. */ -# define BUS_ADRERR BUS_ADRERR - BUS_OBJERR /* Object specific hardware error. */ -# define BUS_OBJERR BUS_OBJERR -}; - -/* `si_code' values for SIGTRAP signal. */ -enum -{ - TRAP_BRKPT = 1, /* Process breakpoint. */ -# define TRAP_BRKPT TRAP_BRKPT - TRAP_TRACE /* Process trace trap. */ -# define TRAP_TRACE TRAP_TRACE -}; - -/* `si_code' values for SIGCHLD signal. */ -enum -{ - CLD_EXITED = 1, /* Child has exited. */ -# define CLD_EXITED CLD_EXITED - CLD_KILLED, /* Child was killed. */ -# define CLD_KILLED CLD_KILLED - CLD_DUMPED, /* Child terminated abnormally. */ -# define CLD_DUMPED CLD_DUMPED - CLD_TRAPPED, /* Traced child has trapped. */ -# define CLD_TRAPPED CLD_TRAPPED - CLD_STOPPED, /* Child has stopped. */ -# define CLD_STOPPED CLD_STOPPED - CLD_CONTINUED /* Stopped child has continued. */ -# define CLD_CONTINUED CLD_CONTINUED -}; - -/* `si_code' values for SIGPOLL signal. */ -enum -{ - POLL_IN = 1, /* Data input available. */ -# define POLL_IN POLL_IN - POLL_OUT, /* Output buffers available. */ -# define POLL_OUT POLL_OUT - POLL_MSG, /* Input message available. */ -# define POLL_MSG POLL_MSG - POLL_ERR, /* I/O error. */ -# define POLL_ERR POLL_ERR - POLL_PRI, /* High priority input available. */ -# define POLL_PRI POLL_PRI - POLL_HUP /* Device disconnected. */ -# define POLL_HUP POLL_HUP -}; - -# undef __need_siginfo_t -#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ - - -#if (defined _SIGNAL_H || defined __need_sigevent_t) \ - && !defined __have_sigevent_t -# define __have_sigevent_t 1 - -/* Structure to transport application-defined values with signals. */ -# define __SIGEV_MAX_SIZE 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) - -/* Forward declaration of the `pthread_attr_t' type. */ -struct __pthread_attr_s; - -/* XXX This one might need to change!!! */ -typedef struct sigevent - { - sigval_t sigev_value; - int sigev_signo; - int sigev_notify; - - union - { - int _pad[__SIGEV_PAD_SIZE]; - - struct - { - void (*_function) (sigval_t); /* Function to start. */ - void *_attribute; /* Really pthread_attr_t. */ - } _sigev_thread; - } _sigev_un; - } sigevent_t; - -/* POSIX names to access some of the members. */ -# define sigev_notify_function _sigev_un._sigev_thread._function -# define sigev_notify_attributes _sigev_un._sigev_thread._attribute - -/* `sigev_notify' values. */ -enum -{ - SIGEV_SIGNAL = 0, /* Notify via signal. */ -# define SIGEV_SIGNAL SIGEV_SIGNAL - SIGEV_NONE, /* Other notification: meaningless. */ -# define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD, /* Deliver via thread creation. */ -# define SIGEV_THREAD SIGEV_THREAD - - SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ -#define SIGEV_THREAD_ID SIGEV_THREAD_ID -}; - -#endif /* have _SIGNAL_H. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/signum.h b/sysdeps/unix/sysv/linux/mips/bits/signum.h deleted file mode 100644 index a9b6848346..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/signum.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -#ifdef __USE_UNIX98 -# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ -#endif - - -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGEMT 7 -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* BUS error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power failure restart (System V). */ -#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ -#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */ -#define SIGIO 22 /* I/O now possible (4.2 BSD). */ -#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ -#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 24 /* Keyboard stop (POSIX). */ -#define SIGCONT 25 /* Continue (POSIX). */ -#define SIGTTIN 26 /* Background read from tty (POSIX). */ -#define SIGTTOU 27 /* Background write to tty (POSIX). */ -#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ -#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ - - -#define _NSIG 128 /* Biggest signal number + 1 - (including real-time signals). */ - -#define SIGRTMIN (__libc_current_sigrtmin ()) -#define SIGRTMAX (__libc_current_sigrtmax ()) - -/* These are the hard limits of the kernel. These values should not be - used directly at user level. */ -#define __SIGRTMIN 32 -#define __SIGRTMAX (_NSIG - 1) - -#endif /* <signal.h> included. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h b/sysdeps/unix/sysv/linux/mips/bits/sigstack.h deleted file mode 100644 index d2c8552209..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h +++ /dev/null @@ -1,55 +0,0 @@ -/* sigstack, sigaltstack definitions. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SIGNAL_H -# error "Never include this file directly. Use <signal.h> instead" -#endif - - -/* Structure describing a signal stack (obsolete). */ -struct sigstack - { - void *ss_sp; /* Signal stack pointer. */ - int ss_onstack; /* Nonzero if executing on this stack. */ - }; - - -/* Possible values for `ss_flags.'. */ -enum -{ - SS_ONSTACK = 1, -#define SS_ONSTACK SS_ONSTACK - SS_DISABLE -#define SS_DISABLE SS_DISABLE -}; - -/* Minimum stack size for a signal handler. */ -#define MINSIGSTKSZ 2048 - -/* System default stack size. */ -#define SIGSTKSZ 8192 - - -/* Alternate, preferred interface. */ -typedef struct sigaltstack - { - void *ss_sp; - size_t ss_size; - int ss_flags; - } stack_t; diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h deleted file mode 100644 index 0e4a2beac7..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ /dev/null @@ -1,315 +0,0 @@ -/* System-specific socket constants and types. Linux/MIPS version. - Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef __BITS_SOCKET_H -#define __BITS_SOCKET_H - -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H -# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead." -#endif - -#define __need_size_t -#define __need_NULL -#include <stddef.h> - -#include <limits.h> -#include <sys/types.h> - -/* Type for length arguments in socket calls. */ -#ifndef __socklen_t_defined -typedef __socklen_t socklen_t; -# define __socklen_t_defined -#endif - -/* Types of sockets. */ -enum __socket_type -{ - SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams - of fixed maximum length. */ -#define SOCK_DGRAM SOCK_DGRAM - SOCK_STREAM = 2, /* Sequenced, reliable, connection-based - byte streams. */ -#define SOCK_STREAM SOCK_STREAM - SOCK_RAW = 3, /* Raw protocol interface. */ -#define SOCK_RAW SOCK_RAW - SOCK_RDM = 4, /* Reliably-delivered messages. */ -#define SOCK_RDM SOCK_RDM - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, - datagrams of fixed maximum length. */ -#define SOCK_SEQPACKET SOCK_SEQPACKET - SOCK_PACKET = 10 /* Linux specific way of getting packets - at the dev level. For writing rarp and - other similar things on the user level. */ -#define SOCK_PACKET SOCK_PACKET -}; - -/* Protocol families. */ -#define PF_UNSPEC 0 /* Unspecified. */ -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ -#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ -#define PF_INET 2 /* IP protocol family. */ -#define PF_AX25 3 /* Amateur Radio AX.25. */ -#define PF_IPX 4 /* Novell Internet Protocol. */ -#define PF_APPLETALK 5 /* Appletalk DDP. */ -#define PF_NETROM 6 /* Amateur radio NetROM. */ -#define PF_BRIDGE 7 /* Multiprotocol bridge. */ -#define PF_ATMPVC 8 /* ATM PVCs. */ -#define PF_X25 9 /* Reserved for X.25 project. */ -#define PF_INET6 10 /* IP version 6. */ -#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ -#define PF_DECnet 12 /* Reserved for DECnet project. */ -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ -#define PF_SECURITY 14 /* Security callback pseudo AF. */ -#define PF_KEY 15 /* PF_KEY key management API. */ -#define PF_NETLINK 16 -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ -#define PF_PACKET 17 /* Packet family. */ -#define PF_ASH 18 /* Ash. */ -#define PF_ECONET 19 /* Acorn Econet. */ -#define PF_ATMSVC 20 /* ATM SVCs. */ -#define PF_SNA 22 /* Linux SNA Project */ -#define PF_IRDA 23 /* IRDA sockets. */ -#define PF_PPPOX 24 /* PPPoX sockets. */ -#define PF_WANPIPE 25 /* Wanpipe API sockets. */ -#define PF_BLUETOOTH 31 /* Bluetooth sockets. */ -#define PF_MAX 32 /* For now.. */ - -/* Address families. */ -#define AF_UNSPEC PF_UNSPEC -#define AF_LOCAL PF_LOCAL -#define AF_UNIX PF_UNIX -#define AF_FILE PF_FILE -#define AF_INET PF_INET -#define AF_AX25 PF_AX25 -#define AF_IPX PF_IPX -#define AF_APPLETALK PF_APPLETALK -#define AF_NETROM PF_NETROM -#define AF_BRIDGE PF_BRIDGE -#define AF_ATMPVC PF_ATMPVC -#define AF_X25 PF_X25 -#define AF_INET6 PF_INET6 -#define AF_ROSE PF_ROSE -#define AF_DECnet PF_DECnet -#define AF_NETBEUI PF_NETBEUI -#define AF_SECURITY PF_SECURITY -#define AF_KEY PF_KEY -#define AF_NETLINK PF_NETLINK -#define AF_ROUTE PF_ROUTE -#define AF_PACKET PF_PACKET -#define AF_ASH PF_ASH -#define AF_ECONET PF_ECONET -#define AF_ATMSVC PF_ATMSVC -#define AF_SNA PF_SNA -#define AF_IRDA PF_IRDA -#define AF_PPPOX PF_PPPOX -#define AF_WANPIPE PF_WANPIPE -#define AF_BLUETOOTH PF_BLUETOOTH -#define AF_MAX PF_MAX - -/* Socket level values. Others are defined in the appropriate headers. - - XXX These definitions also should go into the appropriate headers as - far as they are available. */ -#define SOL_RAW 255 -#define SOL_DECNET 261 -#define SOL_X25 262 -#define SOL_PACKET 263 -#define SOL_ATM 264 /* ATM layer (cell level). */ -#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ -#define SOL_IRDA 266 - -/* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 - -/* Get the definition of the macro to define the common sockaddr members. */ -#include <bits/sockaddr.h> - -/* Structure describing a generic socket address. */ -struct sockaddr - { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ - }; - - -/* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ -#if ULONG_MAX > 0xffffffff -# define __ss_aligntype __uint64_t -#else -# define __ss_aligntype __uint32_t -#endif -#define _SS_SIZE 128 -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) - -struct sockaddr_storage - { - __SOCKADDR_COMMON (ss_); /* Address family, etc. */ - __ss_aligntype __ss_align; /* Force desired alignment. */ - char __ss_padding[_SS_PADSIZE]; - }; - - -/* Bits in the FLAGS argument to `send', `recv', et al. */ -enum - { - MSG_OOB = 0x01, /* Process out-of-band data. */ -#define MSG_OOB MSG_OOB - MSG_PEEK = 0x02, /* Peek at incoming messages. */ -#define MSG_PEEK MSG_PEEK - MSG_DONTROUTE = 0x04, /* Don't use local routing. */ -#define MSG_DONTROUTE MSG_DONTROUTE -#ifdef __USE_GNU - /* DECnet uses a different name. */ - MSG_TRYHARD = MSG_DONTROUTE, -# define MSG_TRYHARD MSG_DONTROUTE -#endif - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ -#define MSG_CTRUNC MSG_CTRUNC - MSG_PROXY = 0x10, /* Supply or ask second address. */ -#define MSG_PROXY MSG_PROXY - MSG_TRUNC = 0x20, -#define MSG_TRUNC MSG_TRUNC - MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ -#define MSG_DONTWAIT MSG_DONTWAIT - MSG_EOR = 0x80, /* End of record. */ -#define MSG_EOR MSG_EOR - MSG_WAITALL = 0x100, /* Wait for a full request. */ -#define MSG_WAITALL MSG_WAITALL - MSG_FIN = 0x200, -#define MSG_FIN MSG_FIN - MSG_SYN = 0x400, -#define MSG_SYN MSG_SYN - MSG_CONFIRM = 0x800, /* Confirm path validity. */ -#define MSG_CONFIRM MSG_CONFIRM - MSG_RST = 0x1000, -#define MSG_RST MSG_RST - MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ -#define MSG_ERRQUEUE MSG_ERRQUEUE - MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ -#define MSG_NOSIGNAL MSG_NOSIGNAL - MSG_MORE = 0x8000 /* Sender will send more. */ -#define MSG_MORE MSG_MORE - }; - - -/* Structure describing messages sent by - `sendmsg' and received by `recvmsg'. */ -struct msghdr - { - void *msg_name; /* Address to send to/receive from. */ - socklen_t msg_namelen; /* Length of address data. */ - - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ - - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ - size_t msg_controllen; /* Ancillary data buffer length. */ - - int msg_flags; /* Flags on received message. */ - }; - -/* Structure used for storage of ancillary data object information. */ -struct cmsghdr - { - size_t cmsg_len; /* Length of data in cmsg_data plus length - of cmsghdr structure. */ - int cmsg_level; /* Originating protocol. */ - int cmsg_type; /* Protocol specific type. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ -#endif - }; - -/* Ancillary data object manipulation macros. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) -#else -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) -#endif -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) -#define CMSG_FIRSTHDR(mhdr) \ - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ - & (size_t) ~(sizeof (size_t) - 1)) -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ - + CMSG_ALIGN (sizeof (struct cmsghdr))) -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) - -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, - struct cmsghdr *__cmsg) __THROW; -#ifdef __USE_EXTERN_INLINES -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif -_EXTERN_INLINE struct cmsghdr * -__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) -{ - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) - /* The kernel header does this so there may be a reason. */ - return 0; - - __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg - + CMSG_ALIGN (__cmsg->cmsg_len)); - if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control - + __mhdr->msg_controllen) - || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) - /* No more entries. */ - return 0; - return __cmsg; -} -#endif /* Use `extern inline'. */ - -/* Socket level message types. This must match the definitions in - <linux/socket.h>. */ -enum - { - SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ -#define SCM_RIGHTS SCM_RIGHTS -#ifdef __USE_BSD - , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ -# define SCM_CREDENTIALS SCM_CREDENTIALS -#endif - }; - -/* User visible structure for SCM_CREDENTIALS message */ - -struct ucred -{ - pid_t pid; /* PID of sending process. */ - uid_t uid; /* UID of sending process. */ - gid_t gid; /* GID of sending process. */ -}; - -/* Get socket manipulation related informations from kernel headers. */ -#include <asm/socket.h> - - -/* Structure used to manipulate the SO_LINGER option. */ -struct linger - { - int l_onoff; /* Nonzero to linger on close. */ - int l_linger; /* Time to linger. */ - }; - -#endif /* bits/socket.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h deleted file mode 100644 index 9ae38cd8d0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/stat.h +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_STAT_H -# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." -#endif - -#include <sgidefs.h> - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ - - -#if _MIPS_SIM == _ABIO32 -/* Structure describing file characteristics. */ -struct stat - { - unsigned long int st_dev; - long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -#else - __ino64_t st_ino; /* File serial number. */ -#endif - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 - long int st_pad2[2]; - __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long int st_pad3; -#else - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -#endif - /* - * Actually this should be timestruc_t st_atime, st_mtime and - * st_ctime but we don't have it under Linux. - */ - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; - __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else - long int st_pad4; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif - long int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - unsigned long int st_dev; - long int st_pad1[3]; - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ - /* - * Actually this should be timestruc_t st_atime, st_mtime and - * st_ctime but we don't have it under Linux. - */ - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; - __blksize_t st_blksize; /* Optimal block size for I/O. */ - long int st_pad3; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ - long int st_pad4[14]; - }; -#endif -#else -struct stat - { - __dev_t st_dev; - int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; -#else - __ino64_t st_ino; -#endif - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 - unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ - __off_t st_size; - int st_pad3; -#else - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -#endif - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; - __blksize_t st_blksize; - unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; -#else - __blkcnt64_t st_blocks; -#endif - int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; - unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ - __ino64_t st_ino; - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; - __blksize_t st_blksize; - unsigned int st_pad3; - __blkcnt64_t st_blocks; - int st_pad4[14]; -}; -#endif -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* POSIX.1b objects. Note that these macros always evaluate to zero. But - they do it by enforcing the correct use of the macros. */ -#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) -#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h deleted file mode 100644 index 2f9bd54edc..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/statfs.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_STATFS_H -# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." -#endif - -#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ - -struct statfs - { - long int f_type; -#define f_fstyp f_type - long int f_bsize; - long int f_frsize; /* Fragment size - unsupported */ -#ifndef __USE_FILE_OFFSET64 - __fsblkcnt_t f_blocks; - __fsblkcnt_t f_bfree; - __fsblkcnt_t f_files; - __fsblkcnt_t f_ffree; - __fsblkcnt_t f_bavail; -#else - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_files; - __fsblkcnt64_t f_ffree; - __fsblkcnt64_t f_bavail; -#endif - - /* Linux specials */ - __fsid_t f_fsid; - long int f_namelen; - long int f_spare[6]; - }; - -#ifdef __USE_LARGEFILE64 -struct statfs64 - { - long int f_type; -#define f_fstyp f_type - long int f_bsize; - long int f_frsize; /* Fragment size - unsupported */ - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_files; - __fsblkcnt64_t f_ffree; - __fsblkcnt64_t f_bavail; - - /* Linux specials */ - __fsid_t f_fsid; - long int f_namelen; - long int f_spare[6]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATFS_F_NAMELEN diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h deleted file mode 100644 index 4ff6e37ad6..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ /dev/null @@ -1,218 +0,0 @@ -/* termios type and macro definitions. Linux/MIPS version. - Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _TERMIOS_H -# error "Never include <bits/termios.h> directly; use <termios.h> instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 32 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - }; - -/* c_cc characters */ -#define VINTR 0 /* Interrupt character [ISIG]. */ -#define VQUIT 1 /* Quit character [ISIG]. */ -#define VERASE 2 /* Erase character [ICANON]. */ -#define VKILL 3 /* Kill-line character [ICANON]. */ -#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ -#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ -#define VEOL2 6 /* Second EOL character [ICANON]. */ -#define VSWTC 7 -#define VSWTCH VSWTC -#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ -#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ -#define VSUSP 10 /* Suspend character [ISIG]. */ - /* VDSUSP is not supported on Linux. */ -/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ -#define VREPRINT 12 /* Reprint-line character [ICANON]. */ -#define VDISCARD 13 /* Discard character [IEXTEN]. */ -#define VWERASE 14 /* Word-erase character [ICANON]. */ -#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ -#define VEOF 16 /* End-of-file character [ICANON]. */ -#define VEOL 17 /* End-of-line character [ICANON]. */ - -/* c_iflag bits */ -#define IGNBRK 0000001 /* Ignore break condition. */ -#define BRKINT 0000002 /* Signal interrupt on break. */ -#define IGNPAR 0000004 /* Ignore characters with parity errors. */ -#define PARMRK 0000010 /* Mark parity and framing errors. */ -#define INPCK 0000020 /* Enable input parity check. */ -#define ISTRIP 0000040 /* Strip 8th bit off characters. */ -#define INLCR 0000100 /* Map NL to CR on input. */ -#define IGNCR 0000200 /* Ignore CR. */ -#define ICRNL 0000400 /* Map CR to NL on input. */ -#define IUCLC 0001000 /* Map upper case to lower case on input. */ -#define IXON 0002000 /* Enable start/stop output control. */ -#define IXANY 0004000 /* Any character will restart after stop. */ -#define IXOFF 0010000 /* Enable start/stop input control. */ -#define IMAXBEL 0020000 /* Ring bell when input queue is full. */ -#define IUTF8 0040000 /* Input is UTF8. */ - -/* c_oflag bits */ -#define OPOST 0000001 /* Perform output processing. */ -#define OLCUC 0000002 /* Map lower case to upper case on output. */ -#define ONLCR 0000004 /* Map NL to CR-NL on output. */ -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0000400 -# define NL0 0000000 -# define NL1 0000400 -# define CRDLY 0003000 -# define CR0 0000000 -# define CR1 0001000 -# define CR2 0002000 -# define CR3 0003000 -# define TABDLY 0014000 -# define TAB0 0000000 -# define TAB1 0004000 -# define TAB2 0010000 -# define TAB3 0014000 -# define BSDLY 0020000 -# define BS0 0000000 -# define BS1 0020000 -# define FFDLY 0100000 -# define FF0 0000000 -# define FF1 0100000 -#endif - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#ifdef __USE_MISC -# define XTABS 0014000 -#endif - -/* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0010017 -#endif -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#define CSIZE 0000060 /* Number of bits per byte (mask). */ -#define CS5 0000000 /* 5 bits per byte. */ -#define CS6 0000020 /* 6 bits per byte. */ -#define CS7 0000040 /* 7 bits per byte. */ -#define CS8 0000060 /* 8 bits per byte. */ -#define CSTOPB 0000100 /* Two stop bits instead of one. */ -#define CREAD 0000200 /* Enable receiver. */ -#define PARENB 0000400 /* Parity enable. */ -#define PARODD 0001000 /* Odd parity instead of even. */ -#define HUPCL 0002000 /* Hang up on last close. */ -#define CLOCAL 0004000 /* Ignore modem status lines. */ -#ifdef __USE_MISC -# define CBAUDEX 0010000 -#endif -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 -#ifdef __USE_MISC -# define CIBAUD 002003600000 /* input baud rate (not used) */ -# define CRTSCTS 020000000000 /* flow control */ -#endif - -/* c_lflag bits */ -#define ISIG 0000001 /* Enable signals. */ -#define ICANON 0000002 /* Do erase and kill processing. */ -#if defined __USE_MISC || defined __USE_XOPEN -# define XCASE 0000004 -#endif -#define ECHO 0000010 /* Enable echo. */ -#define ECHOE 0000020 /* Visual erase for ERASE. */ -#define ECHOK 0000040 /* Echo NL after KILL. */ -#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ -#define NOFLSH 0000200 /* Disable flush after interrupt. */ -#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ -#ifdef __USE_MISC -# define ECHOCTL 0001000 /* Echo control characters as ^X. */ -# define ECHOPRT 0002000 /* Hardcopy visual erase. */ -# define ECHOKE 0004000 /* Visual erase for KILL. */ -# define FLUSHO 0020000 -# define PENDIN 0040000 /* Retype pending input (state). */ -#endif -#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ -#define ITOSTOP TOSTOP - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 /* Suspend output. */ -#define TCOON 1 /* Restart suspended output. */ -#define TCIOFF 2 /* Send a STOP character. */ -#define TCION 3 /* Send a START character. */ - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 /* Discard data received but not yet read. */ -#define TCOFLUSH 1 /* Discard data written but not yet sent. */ -#define TCIOFLUSH 2 /* Discard all pending data. */ - -/* tcsetattr uses these */ -#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ -#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ -#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c deleted file mode 100644 index 00056bee7a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/brk.c +++ /dev/null @@ -1,57 +0,0 @@ -/* brk system call for Linux/MIPS. - Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <unistd.h> -#include <sysdep.h> - -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - { - register long int res __asm__ ("$2"); - - asm ("move\t$4,%2\n\t" - "li\t%0,%1\n\t" - "syscall" /* Perform the system call. */ - : "=r" (res) - : "I" (SYS_ify (brk)), "r" (addr) - : "$4", "$7", __SYSCALL_CLOBBERS); - newbrk = (void *) res; - } - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S deleted file mode 100644 index f521df1771..0000000000 --- a/sysdeps/unix/sysv/linux/mips/clone.S +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright (C) 1996, 1997, 2000, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@linux-mips.org>, 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* clone() is even more special than fork() as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <sys/asm.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#ifdef RESET_PID -#include <tls.h> -#endif - -#define CLONE_VM 0x00000100 -#define CLONE_THREAD 0x00010000 - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, - void *parent_tidptr, void *tls, void *child_tidptr) */ - - .text -#if _MIPS_SIM == _ABIO32 -# define EXTRA_LOCALS 1 -#else -# define EXTRA_LOCALS 0 -#endif -LOCALSZ= 4 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -GPOFF= FRAMESZ-(1*SZREG) -NESTED(__clone,4*SZREG,sp) -#ifdef __PIC__ - SETUP_GP -#endif - PTR_SUBU sp, FRAMESZ - SETUP_GP64 (GPOFF, __clone) -#ifdef __PIC__ - SAVE_GP (GPOFF) -#endif -#ifdef PROF - .set noat - move $1,ra - jal _mcount - .set at -#endif - - - /* Sanity check arguments. */ - li v0,EINVAL - beqz a0,L(error) /* No NULL function pointers. */ - beqz a1,L(error) /* No NULL stack pointers. */ - - PTR_SUBU a1,32 /* Reserve argument save space. */ - PTR_S a0,0(a1) /* Save function pointer. */ - PTR_S a3,PTRSIZE(a1) /* Save argument pointer. */ -#ifdef RESET_PID - LONG_S a2,(PTRSIZE*2)(a1) /* Save clone flags. */ -#endif - - move a0,a2 - - /* Shuffle in the last three arguments - arguments 5, 6, and 7 to - this function, but arguments 3, 4, and 5 to the syscall. */ -#if _MIPS_SIM == _ABIO32 - PTR_L a2,(FRAMESZ+PTRSIZE+PTRSIZE+16)(sp) - PTR_S a2,16(sp) - PTR_L a2,(FRAMESZ+16)(sp) - PTR_L a3,(FRAMESZ+PTRSIZE+16)(sp) -#else - move a2,a4 - move a3,a5 - move a4,a6 -#endif - - /* Do the system call */ - li v0,__NR_clone - syscall - - bnez a3,L(error) - beqz v0,L(thread_start) - - /* Successful return from the parent */ - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - ret - - /* Something bad happened -- no child created */ -L(error): -#ifdef __PIC__ - PTR_LA t9,__syscall_error - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - jr t9 -#else - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - j __syscall_error -#endif - END(__clone) - -/* Load up the arguments to the function. Put this block of code in - its own function so that we can terminate the stack trace with our - debug info. */ - -ENTRY(__thread_start) -L(thread_start): - /* cp is already loaded. */ - SAVE_GP (GPOFF) - /* The stackframe has been created on entry of clone(). */ - -#ifdef RESET_PID - /* Check and see if we need to reset the PID. */ - LONG_L a0,(PTRSIZE*2)(sp) - and a1,a0,CLONE_THREAD - beqz a1,L(restore_pid) -L(donepid): -#endif - - /* Restore the arg for user's function. */ - PTR_L t9,0(sp) /* Function pointer. */ - PTR_L a0,PTRSIZE(sp) /* Argument pointer. */ - - /* Call the user's function. */ - jal t9 - - /* Call _exit rather than doing it inline for breakpoint purposes. */ - move a0,v0 -#ifdef __PIC__ - PTR_LA t9,_exit - jalr t9 -#else - jal _exit -#endif - -#ifdef RESET_PID -L(restore_pid): - and a1,a0,CLONE_VM - li v0,-1 - bnez a1,L(gotpid) - li v0,__NR_getpid - syscall -L(gotpid): - READ_THREAD_POINTER(v1) - INT_S v0,PID_OFFSET(v1) - INT_S v0,TID_OFFSET(v1) - b L(donepid) -#endif - - END(__thread_start) - -weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure deleted file mode 100755 index 4d9568f001..0000000000 --- a/sysdeps/unix/sysv/linux/mips/configure +++ /dev/null @@ -1,78 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/unix/sysv/linux/mips. - -case $machine in -mips*64*) - rm -f asm-unistd.h - asm_unistd_h=$sysheaders/asm/unistd.h - if test ! -f $asm_unistd_h; then - # Try to find asm/unistd.h in compiler header search path. - try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - | - sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'` - if test -n "$try_asm_unistd_h" && - test -f "$try_asm_unistd_h"; then - asm_unistd_h=$try_asm_unistd_h - fi - fi - if test ! -f "$asm_unistd_h"; then - { echo "$as_me:$LINENO: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&5 -echo "$as_me: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&2;} - echo '#include <asm/unistd.h>' > asm-unistd.h - elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then - # The point of this preprocessing is to turn __NR_<syscall> into - # __NR_N64_<syscall>, as well as to define __NR_<syscall> to - # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined - # and <abi> is the compiler-enabled ABI. - cat "$asm_unistd_h" | - sed -e 's,__NR_,__NR_N64_,g' \ - -e 's,__NR_N64_##,__NR_##,g' \ - -e 's,__NR_N64_O32_,__NR_O32_,g' \ - -e 's,__NR_N64_N32_,__NR_N32_,g' \ - -e 's,__NR_N64_N64_,__NR_N64_,g' \ - | awk > asm-unistd.h ' -BEGIN { print "#include <sgidefs.h>"; } -/^#define __NR.*unused/ { print; next; } -/^#define __NR_N64__exit __NR_N64_exit/ { - print "#define __NR__exit __NR_exit"; - print "#define __NR_O32__exit __NR_O32_exit"; - print "#define __NR_N32__exit __NR_N32_exit"; - print; next; -} -/^#define __NR_O32_/ { - name = $2; - sub (/_O32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIO32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N32_/ { - name = $2; - sub (/_N32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIN32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N64_/ { - name = $2; - sub (/_N64_/, "_", name); - print; - print "#if _MIPS_SIM == _ABI64"; - print "# define " name " " $2; - print "#endif"; - next; -} -{ - print; -}' - else - echo '#include <asm/unistd.h>' > asm-unistd.h - fi ;; -mips*) - rm -f asm-unistd.h - echo '#include <asm/unistd.h>' > asm-unistd.h - ;; -esac diff --git a/sysdeps/unix/sysv/linux/mips/configure.in b/sysdeps/unix/sysv/linux/mips/configure.in deleted file mode 100644 index e2e5d16c55..0000000000 --- a/sysdeps/unix/sysv/linux/mips/configure.in +++ /dev/null @@ -1,78 +0,0 @@ -sinclude(./aclocal.m4)dnl Autoconf lossage -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/unix/sysv/linux/mips. - -case $machine in -mips*64*) - rm -f asm-unistd.h - asm_unistd_h=$sysheaders/asm/unistd.h - if test ! -f $asm_unistd_h; then - # Try to find asm/unistd.h in compiler header search path. - try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - | - sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'` - if test -n "$try_asm_unistd_h" && - test -f "$try_asm_unistd_h"; then - asm_unistd_h=$try_asm_unistd_h - fi - fi - if test ! -f "$asm_unistd_h"; then - AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed]) - echo '#include <asm/unistd.h>' > asm-unistd.h - elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then - # The point of this preprocessing is to turn __NR_<syscall> into - # __NR_N64_<syscall>, as well as to define __NR_<syscall> to - # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined - # and <abi> is the compiler-enabled ABI. - cat "$asm_unistd_h" | - sed -e 's,__NR_,__NR_N64_,g' \ - -e 's,__NR_N64_##,__NR_##,g' \ - -e 's,__NR_N64_O32_,__NR_O32_,g' \ - -e 's,__NR_N64_N32_,__NR_N32_,g' \ - -e 's,__NR_N64_N64_,__NR_N64_,g' \ - | awk > asm-unistd.h ' -BEGIN { print "#include <sgidefs.h>"; } -/^#define __NR.*unused/ { print; next; } -/^#define __NR_N64__exit __NR_N64_exit/ { - print "#define __NR__exit __NR_exit"; - print "#define __NR_O32__exit __NR_O32_exit"; - print "#define __NR_N32__exit __NR_N32_exit"; - print; next; -} -/^#define __NR_O32_/ { - name = $2; - sub (/_O32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIO32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N32_/ { - name = $2; - sub (/_N32_/, "_", name); - print; - print "#if _MIPS_SIM == _ABIN32"; - print "# define " name " " $2; - print "#endif"; - next; -} -/^#define __NR_N64_/ { - name = $2; - sub (/_N64_/, "_", name); - print; - print "#if _MIPS_SIM == _ABI64"; - print "# define " name " " $2; - print "#endif"; - next; -} -{ - print; -}' - else - echo '#include <asm/unistd.h>' > asm-unistd.h - fi ;; -mips*) - rm -f asm-unistd.h - echo '#include <asm/unistd.h>' > asm-unistd.h - ;; -esac diff --git a/sysdeps/unix/sysv/linux/mips/dl-cache.h b/sysdeps/unix/sysv/linux/mips/dl-cache.h deleted file mode 100644 index 4fa5d3ad22..0000000000 --- a/sysdeps/unix/sysv/linux/mips/dl-cache.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Support for reading /etc/ld.so.cache files written by Linux ldconfig. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define add_system_dir(dir) \ - do \ - { \ - size_t len = strlen (dir); \ - char path[len + 3]; \ - memcpy (path, dir, len + 1); \ - if (len >= 6 \ - && (! memcmp (path + len - 6, "/lib64", 6) \ - || ! memcmp (path + len - 6, "/lib32", 6))) \ - { \ - len -= 2; \ - path[len] = '\0'; \ - } \ - add_dir (path); \ - if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ - { \ - memcpy (path + len, "32", 3); \ - add_dir (path); \ - memcpy (path + len, "64", 3); \ - add_dir (path); \ - } \ - } while (0) - -#include_next <dl-cache.h> diff --git a/sysdeps/unix/sysv/linux/mips/entry.h b/sysdeps/unix/sysv/linux/mips/entry.h deleted file mode 100644 index 04d05d2b0a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/entry.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __ASSEMBLY__ -extern void __start (void); -#endif - -#define ENTRY_POINT __start diff --git a/sysdeps/unix/sysv/linux/mips/fcntl.c b/sysdeps/unix/sysv/linux/mips/fcntl.c deleted file mode 100644 index ea951bc4f9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/fcntl.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/sysdeps/unix/sysv/linux/mips/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/ftruncate64.c deleted file mode 100644 index a46e22f828..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ftruncate64.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005,2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/types.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <kernel-features.h> - -#ifdef __NR_ftruncate64 -#ifndef __ASSUME_TRUNCATE64_SYSCALL -/* The variable is shared between all wrappers around *truncate64 calls. */ -extern int __have_no_truncate64; -#endif - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -__ftruncate64 (int fd, off64_t length) -{ -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (! __have_no_truncate64) -#endif - { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; -#ifndef __ASSUME_TRUNCATE64_SYSCALL - int saved_errno = errno; -#endif - int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0, - __LONG_LONG_PAIR (high, low)); -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (result != -1 || errno != ENOSYS) -#endif - return result; - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - __set_errno (saved_errno); - __have_no_truncate64 = 1; -#endif - } - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if ((off_t) length != length) - { - __set_errno (EINVAL); - return -1; - } - return __ftruncate (fd, (off_t) length); -#endif -} -weak_alias (__ftruncate64, ftruncate64) - -#else -/* Use the generic implementation. */ -# include <misc/ftruncate64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/getmsg.c b/sysdeps/unix/sysv/linux/mips/getmsg.c deleted file mode 100644 index 3a1fa08525..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/sysdeps/unix/sysv/linux/mips/getpagesize.c b/sysdeps/unix/sysv/linux/mips/getpagesize.c deleted file mode 100644 index 49492e5137..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getpagesize.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/ia64/getpagesize.c> diff --git a/sysdeps/unix/sysv/linux/mips/getsysstats.c b/sysdeps/unix/sysv/linux/mips/getsysstats.c deleted file mode 100644 index 9b521ac76a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/getsysstats.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Determine various system internal values, Linux/MIPS version. - Copyright (C) 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -/* We need to define a special parser for /proc/cpuinfo. */ -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ - do \ - { \ - (RESULT) = 0; \ - /* Read all lines and count the lines starting with the string \ - "cpu model". We don't have to fear extremely long lines since \ - the kernel will not generate them. 8192 bytes are really \ - enough. */ \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ - if (strncmp (BUFFER, "cpu model", 9) == 0) \ - ++(RESULT); \ - } \ - while (0) - -#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/sysdeps/unix/sysv/linux/mips/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/ipc_priv.h deleted file mode 100644 index 9b85386a7c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ipc_priv.h +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/alpha/ipc_priv.h> diff --git a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h b/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h deleted file mode 100644 index b6f52cc9c9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h +++ /dev/null @@ -1,40 +0,0 @@ -/* This is the sigaction structure from the Linux 2.1.24 kernel. */ - -#include <sgidefs.h> - -#define HAVE_SA_RESTORER - -struct old_kernel_sigaction { - unsigned int sa_flags; - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned int __pad0[3]; /* reserved, keep size constant */ - - /* Abi says here follows reserved int[2] */ - void (*sa_restorer)(void); -#if (_MIPS_SZPTR < 64) - /* - * For 32 bit code we have to pad struct sigaction to get - * constant size for the ABI - */ - int pad1[1]; /* reserved */ -#endif -}; - - -#define _KERNEL_NSIG 128 -#define _KERNEL_NSIG_BPW _MIPS_SZLONG -#define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW) - -typedef struct { - unsigned long sig[_KERNEL_NSIG_WORDS]; -} kernel_sigset_t; - -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - unsigned int sa_flags; - __sighandler_t k_sa_handler; - kernel_sigset_t sa_mask; - void (*sa_restorer)(void); - int s_resv[1]; /* reserved */ -}; diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h deleted file mode 100644 index cab1e7110e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h +++ /dev/null @@ -1,57 +0,0 @@ -#include <sgidefs.h> -/* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the - userland data structures are not identical, because of different - padding. */ -/* Definition of `struct stat' used in the kernel. */ -#if _MIPS_SIM != _ABIO32 -struct kernel_stat - { - unsigned int st_dev; - unsigned int __pad1[3]; - unsigned long long st_ino; - unsigned int st_mode; - unsigned int st_nlink; - int st_uid; - int st_gid; - unsigned int st_rdev; - unsigned int __pad2[3]; - long long st_size; - unsigned int st_atime; - unsigned int __unused1; - unsigned int st_mtime; - unsigned int __unused2; - unsigned int st_ctime; - unsigned int __unused3; - unsigned int st_blksize; - unsigned int __pad3; - unsigned long long st_blocks; - }; -#else -struct kernel_stat - { - unsigned long int st_dev; - long int __pad1[3]; /* Reserved for network id */ - unsigned long int st_ino; - unsigned long int st_mode; - unsigned long int st_nlink; - long int st_uid; - long int st_gid; - unsigned long int st_rdev; - long int __pad2[2]; - long int st_size; - long int __pad3; - long int st_atime; - long int __unused1; - long int st_mtime; - long int __unused2; - long int st_ctime; - long int __unused3; - long int st_blksize; - long int st_blocks; - char st_fstype[16]; /* Filesystem type name, unsupported */ - long st_pad4[8]; - /* Linux specific fields */ - unsigned int st_flags; - unsigned int st_gen; - }; -#endif diff --git a/sysdeps/unix/sysv/linux/mips/kernel_termios.h b/sysdeps/unix/sysv/linux/mips/kernel_termios.h deleted file mode 100644 index 9b622f4d1f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/kernel_termios.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _KERNEL_TERMIOS_H -#define _KERNEL_TERMIOS_H 1 -/* The following corresponds to the values from the Linux 2.1.24 kernel. */ - -#define __KERNEL_NCCS 23 - -struct __kernel_termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[__KERNEL_NCCS]; /* control characters */ - }; - -#endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/mips/lockf64.c b/sysdeps/unix/sysv/linux/mips/lockf64.c deleted file mode 100644 index a88f5a784a..0000000000 --- a/sysdeps/unix/sysv/linux/mips/lockf64.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h deleted file mode 100644 index 3da2412259..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LINUX_MIPS_MIPS32_SYSDEP_H -#define _LINUX_MIPS_MIPS32_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips32/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \ - "i" (SYS_ify (name)), err, args) - -#undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - internal_syscall##nr (= number, , "r" (__v0), err, args) - -#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0), "r" (__a1) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - cs_init \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -/* We need to use a frame pointer for the functions in which we - adjust $sp around the syscall, or debug information and unwind - information will be $sp relative and thus wrong during the syscall. As - of GCC 3.4.3, this is sufficient. */ -#define FORCE_FRAME_POINTER alloca (4) - -#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - "sw\t%7, 20($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5), "r" ((long)arg6) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ -({ \ - long _sys_result; \ - \ - FORCE_FRAME_POINTER; \ - { \ - register long __v0 asm("$2") ncs_init; \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "subu\t$29, 32\n\t" \ - "sw\t%6, 16($29)\n\t" \ - "sw\t%7, 20($29)\n\t" \ - "sw\t%8, 24($29)\n\t" \ - cs_init \ - "syscall\n\t" \ - "addiu\t$29, 32\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : input, "r" (__a0), "r" (__a1), "r" (__a2), \ - "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" - -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/mips32/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h b/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h deleted file mode 100644 index d490fb95e2..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdeps/generic/ldconfig.h> - -#define SYSDEP_KNOWN_INTERPRETER_NAMES \ - { "/lib32/ld.so.1", FLAG_ELF_LIBC6 }, \ - { "/lib64/ld.so.1", FLAG_ELF_LIBC6 }, -#define SYSDEP_KNOWN_LIBRARY_NAMES \ - { "libc.so.6", FLAG_ELF_LIBC6 }, \ - { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed deleted file mode 100644 index 2c327327e0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed +++ /dev/null @@ -1 +0,0 @@ -s_^\(RTLDLIST=\)\(.*lib\)\(\|32\|64\)\(/[^/]*\.so\.[0-9.]*\)[ ]*$_\1"\232\4 \264\4 \2\4"_ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c b/sysdeps/unix/sysv/linux/mips/mips64/llseek.c deleted file mode 100644 index 24013a8224..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c +++ /dev/null @@ -1 +0,0 @@ -/* lseek() is 64-bit capable already. */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c deleted file mode 100644 index 42efcba315..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/types.h> - -#include <sysdep.h> - -extern int ftruncate (int fd, off64_t length); - -int __ftruncate64 (int fd, off64_t length) { - return ftruncate (fd, length); -} -weak_alias (__ftruncate64, ftruncate64) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h deleted file mode 100644 index e6013669a4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h +++ /dev/null @@ -1,242 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LINUX_MIPS_SYSDEP_H -#define _LINUX_MIPS_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips64/n32/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args) - -#define internal_syscall0(name, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %2\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(name, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %3\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(name, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %4\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(name, err, arg1, arg2, arg3) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - register long long __a4 asm("$8") = (long long) arg5; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - { \ - register long long __v0 asm("$2"); \ - register long long __a0 asm("$4") = (long long) arg1; \ - register long long __a1 asm("$5") = (long long) arg2; \ - register long long __a2 asm("$6") = (long long) arg3; \ - register long long __a3 asm("$7") = (long long) arg4; \ - register long long __a4 asm("$8") = (long long) arg5; \ - register long long __a5 asm("$9") = (long long) arg6; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4), "r" (__a5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c deleted file mode 100644 index 339023f14f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/types.h> - -#include <sysdep.h> -#include <bp-checks.h> - -extern int truncate (const char *__unbounded path, int dummy, - off64_t length); - -int truncate64 (const char *__unbounded path, int dummy, - off64_t length) { - return truncate (path, dummy, length); -} diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c deleted file mode 100644 index 33918ea6a5..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c +++ /dev/null @@ -1 +0,0 @@ -/* glob64 is in glob.c */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S deleted file mode 100644 index e4b4f00a8c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -#include <sys/asm.h> - -/* Sign-extend the ioctl number, since the kernel wants it as a - sign-extended 32-bit value, but our prototype is that of a long. */ - - .text -ENTRY (__ioctl) - sll a1, a1, 0 - li v0, __NR_ioctl - syscall /* Do the system call. */ - bne a3, zero, L(error) - ret - -L(error): - SETUP_GP64 (a0, __ioctl) - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 - -PSEUDO_END (__ioctl) - -weak_alias (__ioctl, ioctl) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h deleted file mode 100644 index dc0a1a0edc..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h +++ /dev/null @@ -1,242 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LINUX_MIPS_SYSDEP_H -#define _LINUX_MIPS_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/mips/mips64/n64/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif - -#ifdef __ASSEMBLER__ - -/* We don't want the label for the error handler to be visible in the symbol - table when we define it here. */ -#ifdef __PIC__ -# define SYSCALL_ERROR_LABEL 99b -#endif - -#else /* ! __ASSEMBLER__ */ - -/* Define a macro which expands into the inline wrapper code for a system - call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ INTERNAL_SYSCALL_DECL(err); \ - long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ - if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ - result_var = -1L; \ - } \ - result_var; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) long err - -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) - -#undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args) - -#define internal_syscall0(name, err, dummy...) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %2\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall1(name, err, arg1) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %3\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set reorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall2(name, err, arg1, arg2) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %4\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall3(name, err, arg1, arg2, arg3) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7"); \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "=r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - register long __a4 asm("$8") = (long) arg5; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\ -({ \ - long _sys_result; \ - \ - { \ - register long __v0 asm("$2"); \ - register long __a0 asm("$4") = (long) arg1; \ - register long __a1 asm("$5") = (long) arg2; \ - register long __a2 asm("$6") = (long) arg3; \ - register long __a3 asm("$7") = (long) arg4; \ - register long __a4 asm("$8") = (long) arg5; \ - register long __a5 asm("$9") = (long) arg6; \ - __asm__ volatile ( \ - ".set\tnoreorder\n\t" \ - "li\t$2, %5\t\t\t# " #name "\n\t" \ - "syscall\n\t" \ - ".set\treorder" \ - : "=r" (__v0), "+r" (__a3) \ - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ - "r" (__a4), "r" (__a5) \ - : __SYSCALL_CLOBBERS); \ - err = __a3; \ - _sys_result = __v0; \ - } \ - _sys_result; \ -}) - -#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25", "memory" -#endif /* __ASSEMBLER__ */ - -#endif /* linux/mips/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/recv.c b/sysdeps/unix/sysv/linux/mips/mips64/recv.c deleted file mode 100644 index b910525c92..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/recv.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/x86_64/recv.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/send.c b/sysdeps/unix/sysv/linux/mips/mips64/send.c deleted file mode 100644 index d2c2996a21..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/send.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/x86_64/send.c> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S deleted file mode 100644 index 3c6aaac810..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sysdep.h> - -#include <sys/asm.h> - -/* Usage: - long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6, arg7) - - We need to do some arg shifting, syscall_number will be in v0. */ - - - .text -NESTED (syscall, SZREG, ra) - .mask 0x00010000, -SZREG - .fmask 0x00000000, 0 - PTR_ADDIU sp, -SZREG - REG_S s0, (sp) - - move s0, a0 - move a0, a1 /* shift arg1 - arg7. */ - move a1, a2 - move a2, a3 - move a3, a4 - move a4, a5 - move a5, a6 - move a6, a7 - - move v0, s0 /* Syscall number -> v0 */ - syscall /* Do the system call. */ - - REG_L s0, (sp) - PTR_ADDIU sp, SZREG - bne a3, zero, L(error) - - ret - -L(error): - SETUP_GP64 (a0, syscall) - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 - -END (syscall) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list deleted file mode 100644 index b0d79ff6a4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ /dev/null @@ -1,21 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64 - -# proper socket implementations: -recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom -sendto - sendto i:ibnibn __libc_sendto __sendto sendto - -# semaphore and shm system calls -msgctl - msgctl i:iip __msgctl msgctl -msgget - msgget i:ii __msgget msgget -msgrcv - msgrcv i:ibnii __msgrcv msgrcv -msgsnd - msgsnd i:ibni __msgsnd msgsnd -shmat - shmat i:ipi __shmat shmat -shmctl - shmctl i:iip __shmctl shmctl -shmdt - shmdt i:s __shmdt shmdt -shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop -semtimedop - semtimedop i:ipip semtimedop -semget - semget i:iii __semget semget -semctl - semctl i:iiii __semctl semctl diff --git a/sysdeps/unix/sysv/linux/mips/mips64/umount.c b/sysdeps/unix/sysv/linux/mips/mips64/umount.c deleted file mode 100644 index 9a91ba5b2f..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/umount.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/hppa/umount.c> diff --git a/sysdeps/unix/sysv/linux/mips/pipe.S b/sysdeps/unix/sysv/linux/mips/pipe.S deleted file mode 100644 index 1708888da4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/mips/pipe.S> diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c deleted file mode 100644 index eff7d473d0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pread.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <assert.h> -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pread -# error "__NR_pread and __NR_pread64 both defined???" -# endif -# define __NR_pread __NR_pread64 -#endif - -#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 - -# if __ASSUME_PREAD_SYSCALL == 0 -static ssize_t __emulate_pread (int fd, void *buf, size_t count, - off_t offset) internal_function; -# endif - -ssize_t -__libc_pread (fd, buf, count, offset) - int fd; - void *buf; - size_t count; - off_t offset; -{ - ssize_t result; - -#if _MIPS_SIM != _ABI64 - assert (sizeof (offset) == 4); -#endif - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -strong_alias (__libc_pread, __pread) -weak_alias (__libc_pread, pread) - -# define __libc_pread(fd, buf, count, offset) \ - static internal_function __emulate_pread (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include <sysdeps/posix/pread.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c deleted file mode 100644 index d8763acabb..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pread64.c +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pread -# error "__NR_pread and __NR_pread64 both defined???" -# endif -# define __NR_pread __NR_pread64 -#endif - -#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 - -# if __ASSUME_PREAD_SYSCALL == 0 -static ssize_t __emulate_pread64 (int fd, void *buf, size_t count, - off64_t offset) internal_function; -# endif - -ssize_t -__libc_pread64 (fd, buf, count, offset) - int fd; - void *buf; - size_t count; - off64_t offset; -{ - ssize_t result; - - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread64 (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread64 (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -weak_alias (__libc_pread64, __pread64) -weak_alias (__libc_pread64, pread64) - -# define __libc_pread64(fd, buf, count, offset) \ - static internal_function __emulate_pread64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include <sysdeps/posix/pread64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/profil-counter.h b/sysdeps/unix/sysv/linux/mips/profil-counter.h deleted file mode 100644 index 8a6a0bcf3d..0000000000 --- a/sysdeps/unix/sysv/linux/mips/profil-counter.h +++ /dev/null @@ -1,2 +0,0 @@ -/* We can use the ix86 version. */ -#include <sysdeps/unix/sysv/linux/i386/profil-counter.h> diff --git a/sysdeps/unix/sysv/linux/mips/ptrace.c b/sysdeps/unix/sysv/linux/mips/ptrace.c deleted file mode 100644 index 19d7c2d927..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ptrace.c +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <sgidefs.h> -#include <sys/types.h> -#include <sys/ptrace.h> -#include <sys/user.h> -#include <stdarg.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> -#include <sgidefs.h> - -#if _MIPS_SIM == _ABIN32 -__extension__ typedef long long int reg_type; -#else -typedef long int reg_type; -#endif - -reg_type -ptrace (enum __ptrace_request request, ...) -{ - reg_type res, ret; - va_list ap; - pid_t pid; - void *addr; - reg_type data; - - va_start (ap, request); - pid = va_arg (ap, pid_t); - addr = va_arg (ap, void *); - data = va_arg (ap, reg_type); - va_end (ap); - - if (request > 0 && request < 4) - data = &ret; - -#if __BOUNDED_POINTERS__ - switch (request) - { - case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: - case PTRACE_PEEKUSER: - case PTRACE_POKETEXT: - case PTRACE_POKEDATA: - case PTRACE_POKEUSER: - (void) CHECK_1 ((int *) addr); - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETREGS: - case PTRACE_SETREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETFPREGS: - case PTRACE_SETFPREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_GETFPXREGS: - case PTRACE_SETFPXREGS: - /* We don't know the size of data, so the best we can do is ensure - that `data' is valid for at least one word. */ - (void) CHECK_1 ((int *) data); - break; - - case PTRACE_TRACEME: - case PTRACE_CONT: - case PTRACE_KILL: - case PTRACE_SINGLESTEP: - case PTRACE_ATTACH: - case PTRACE_DETACH: - case PTRACE_SYSCALL: - /* Neither `data' nor `addr' needs any checks. */ - break; - }; -#endif - - res = INLINE_SYSCALL (ptrace, 4, request, pid, - __ptrvalue (addr), __ptrvalue (data)); - if (res >= 0 && request > 0 && request < 4) - { - __set_errno (0); - return ret; - } - - return res; -} diff --git a/sysdeps/unix/sysv/linux/mips/putmsg.c b/sysdeps/unix/sysv/linux/mips/putmsg.c deleted file mode 100644 index ebc1680ca7..0000000000 --- a/sysdeps/unix/sysv/linux/mips/putmsg.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c deleted file mode 100644 index 4378ebc859..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pwrite.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <assert.h> -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pwrite -# error "__NR_pwrite and __NR_pwrite64 both defined???" -# endif -# define __NR_pwrite __NR_pwrite64 -#endif - -#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 - -# if __ASSUME_PWRITE_SYSCALL == 0 -static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count, - off_t offset) internal_function; -# endif - -ssize_t -__libc_pwrite (fd, buf, count, offset) - int fd; - const void *buf; - size_t count; - off_t offset; -{ - ssize_t result; - -#if _MIPS_SIM != _ABI64 - assert (sizeof (offset) == 4); -#endif - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite (fd, buf, count, offset); -# endif - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -strong_alias (__libc_pwrite, __pwrite) -weak_alias (__libc_pwrite, pwrite) - -# define __libc_pwrite(fd, buf, count, offset) \ - static internal_function __emulate_pwrite (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include <sysdeps/posix/pwrite.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c deleted file mode 100644 index e5853e432e..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pwrite64.c +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle <ralf@gnu.org>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#ifndef NO_SGIDEFS_H -#include <sgidefs.h> -#endif -#include <unistd.h> -#include <endian.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ -# ifdef __NR_pwrite -# error "__NR_pwrite and __NR_pwrite64 both defined???" -# endif -# define __NR_pwrite __NR_pwrite64 -#endif - -#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 - -# if __ASSUME_PWRITE_SYSCALL == 0 -static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count, - off64_t offset) internal_function; -# endif - -ssize_t -__libc_pwrite64 (fd, buf, count, offset) - int fd; - const void *buf; - size_t count; - off64_t offset; -{ - ssize_t result; - - if (SINGLE_THREAD_P) - { - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, - offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite64 (fd, buf, count, offset); -# endif - - return result; - } - - int oldtype = LIBC_CANCEL_ASYNC (); - - /* First try the syscall. */ -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); -#else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -#endif -# if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite64 (fd, buf, count, offset); -# endif - - LIBC_CANCEL_RESET (oldtype); - - return result; -} - -weak_alias (__libc_pwrite64, __pwrite64) -libc_hidden_weak (__pwrite64) -weak_alias (__libc_pwrite64, pwrite64) - -# define __libc_pwrite64(fd, buf, count, offset) \ - static internal_function __emulate_pwrite64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include <sysdeps/posix/pwrite64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c deleted file mode 100644 index baa92fe57c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/readelflib.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 1999, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - Based on work ../x86_64/readelflib.c, - contributed by Andreas Jaeger <aj@suse.de>, 1999 and - Jakub Jelinek <jakub@redhat.com>, 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -int process_elf32_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, - void *file_contents, size_t file_length); -int process_elf64_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, - void *file_contents, size_t file_length); - -/* Returns 0 if everything is ok, != 0 in case of error. */ -int -process_elf_file (const char *file_name, const char *lib, int *flag, - unsigned int *osversion, char **soname, void *file_contents, - size_t file_length) -{ - ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; - int ret; - - if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - { - ret = process_elf32_file (file_name, lib, flag, osversion, soname, - file_contents, file_length); - - /* n32 libraries are always libc.so.6+. */ - if (ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0) - *flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6; - } - else - { - ret = process_elf64_file (file_name, lib, flag, osversion, soname, - file_contents, file_length); - /* n64 libraries are always libc.so.6+. */ - if (!ret) - *flag = FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6; - } - - return ret; -} - -#undef __ELF_NATIVE_CLASS -#undef process_elf_file -#define process_elf_file process_elf32_file -#define __ELF_NATIVE_CLASS 32 -#include "elf/readelflib.c" - -#undef __ELF_NATIVE_CLASS -#undef process_elf_file -#define process_elf_file process_elf64_file -#define __ELF_NATIVE_CLASS 64 -#include "elf/readelflib.c" diff --git a/sysdeps/unix/sysv/linux/mips/register-dump.h b/sysdeps/unix/sysv/linux/mips/register-dump.h deleted file mode 100644 index f5bd3a2735..0000000000 --- a/sysdeps/unix/sysv/linux/mips/register-dump.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Dump registers. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/uio.h> -#include <stdio-common/_itoa.h> - -/* We will print the register dump in this format: - - R0 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R8 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R16 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - R24 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - pc cause status badvaddr lo hi - XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - The FPU registers will not be printed. -*/ - -static void -hexvalue (unsigned long int value, char *buf, size_t len) -{ - char *cp = _itoa_word (value, buf + len, 16, 0); - while (cp > buf) - *--cp = '0'; -} - -static void -register_dump (int fd, struct sigcontext *ctx) -{ - char regs[38][8]; - struct iovec iov[38 * 2 + 10]; - size_t nr = 0; - int i; - -#define ADD_STRING(str) \ - iov[nr].iov_base = (char *) str; \ - iov[nr].iov_len = strlen (str); \ - ++nr -#define ADD_MEM(str, len) \ - iov[nr].iov_base = str; \ - iov[nr].iov_len = len; \ - ++nr - - /* Generate strings of register contents. */ - for (i = 0; i < 32; i++) - hexvalue (ctx->sc_regs[i], regs[i], 8); - hexvalue (ctx->sc_pc, regs[32], 8); - hexvalue (ctx->sc_cause, regs[33], 8); - hexvalue (ctx->sc_status, regs[34], 8); - hexvalue (ctx->sc_badvaddr, regs[35], 8); - hexvalue (ctx->sc_mdhi, regs[36], 8); - hexvalue (ctx->sc_mdlo, regs[37], 8); - - /* Generate the output. */ - ADD_STRING ("Register dump:\n\n R0 "); - for (i = 0; i < 8; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R8 "); - for (i = 8; i < 16; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R16 "); - for (i = 16; i < 24; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n R24 "); - for (i = 24; i < 32; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n pc cause status badvaddr lo hi\n "); - for (i = 32; i < 38; i++) - { - ADD_MEM (regs[i], 8); - ADD_STRING (" "); - } - ADD_STRING ("\n"); - - /* Write the stuff out. */ - writev (fd, iov, nr); -} - - -#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/sysdeps/unix/sysv/linux/mips/sigaction.c b/sysdeps/unix/sysv/linux/mips/sigaction.c deleted file mode 100644 index 8e2ca42bb4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sigaction.c +++ /dev/null @@ -1,188 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003,2004,2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <sgidefs.h> -#include <signal.h> -#include <string.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <sgidefs.h> - -#include <kernel-features.h> - -/* The difference here is that the sigaction structure used in the - kernel is not the same as we use in the libc. Therefore we must - translate it here. */ -#include <kernel_sigaction.h> - -#if __ASSUME_REALTIME_SIGNALS == 0 -/* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. This is the definition. */ -int __libc_missing_rt_sigs; - -#endif - -#if _MIPS_SIM != _ABIO32 - -# ifdef __NR_rt_sigreturn -static void restore_rt (void) asm ("__restore_rt"); -# endif -# ifdef __NR_sigreturn -static void restore (void) asm ("__restore"); -# endif -#endif - -/* If ACT is not NULL, change the action for SIG to *ACT. - If OACT is not NULL, put the old action for SIG in *OACT. */ -int -__libc_sigaction (sig, act, oact) - int sig; - const struct sigaction *act; - struct sigaction *oact; -{ -#if __ASSUME_REALTIME_SIGNALS == 0 - struct old_kernel_sigaction k_sigact, k_osigact; -#endif - int result; - -#if defined __NR_rt_sigaction || __ASSUME_REALTIME_SIGNALS > 0 - /* First try the RT signals. */ -# if __ASSUME_REALTIME_SIGNALS == 0 - if (!__libc_missing_rt_sigs) -# endif - { - struct kernel_sigaction kact, koact; - /* Save the current error value for later. We need not do this - if we are guaranteed to have realtime signals. */ -# if __ASSUME_REALTIME_SIGNALS == 0 - int saved_errno = errno; -# endif - - if (act) - { - kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t)); - kact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER -# if _MIPS_SIM == _ABIO32 - kact.sa_restorer = act->sa_restorer; -# else - kact.sa_restorer = &restore_rt; -# endif -# endif - } - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, - act ? __ptrvalue (&kact) : NULL, - oact ? __ptrvalue (&koact) : NULL, - sizeof (kernel_sigset_t)); - -# if __ASSUME_REALTIME_SIGNALS == 0 - if (result >= 0 || errno != ENOSYS) -# endif - { - if (oact && result >= 0) - { - oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, - sizeof (kernel_sigset_t)); - oact->sa_flags = koact.sa_flags; -# ifdef HAVE_SA_RESTORER - oact->sa_restorer = koact.sa_restorer; -# endif - } - return result; - } - -# if __ASSUME_REALTIME_SIGNALS == 0 - __set_errno (saved_errno); - __libc_missing_rt_sigs = 1; -# endif - } -#endif - -#if __ASSUME_REALTIME_SIGNALS == 0 - if (act) - { - k_sigact.k_sa_handler = act->sa_handler; - k_sigact.sa_mask = act->sa_mask.__val[0]; - k_sigact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER - k_sigact.sa_restorer = act->sa_restorer; -# endif - } - result = INLINE_SYSCALL (sigaction, 3, sig, - act ? __ptrvalue (&k_sigact) : NULL, - oact ? __ptrvalue (&k_osigact) : NULL); - if (oact && result >= 0) - { - oact->sa_handler = k_osigact.k_sa_handler; - oact->sa_mask.__val[0] = k_osigact.sa_mask; - oact->sa_flags = k_osigact.sa_flags; -# ifdef HAVE_SA_RESTORER -# if _MIPS_SIM == _ABIO32 - oact->sa_restorer = k_osigact.sa_restorer; -# else - oact->sa_restorer = &restore; -# endif -# endif - } - return result; -#endif -} -libc_hidden_def (__libc_sigaction) - -#ifndef LIBC_SIGACTION -weak_alias (__libc_sigaction, __sigaction) -libc_hidden_weak (__sigaction) -weak_alias (__libc_sigaction, sigaction) -#endif - -/* NOTE: Please think twice before making any changes to the bits of - code below. GDB needs some intimate knowledge about it to - recognize them as signal trampolines, and make backtraces through - signal handlers work right. Important are both the names - (__restore_rt) and the exact instruction sequence. - If you ever feel the need to make any changes, please notify the - appropriate GDB maintainer. */ - -#define RESTORE(name, syscall) RESTORE2 (name, syscall) -#define RESTORE2(name, syscall) \ -asm \ - ( \ - ".align 4\n" \ - "__" #name ":\n" \ - " li $2, " #syscall "\n" \ - " syscall\n" \ - ); - -/* The return code for realtime-signals. */ -#if _MIPS_SIM != _ABIO32 -# ifdef __NR_rt_sigreturn -RESTORE (restore_rt, __NR_rt_sigreturn) -# endif -# ifdef __NR_sigreturn -RESTORE (restore, __NR_sigreturn) -# endif -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h deleted file mode 100644 index f453c8d9b5..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@suse.de>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - -#include <sgidefs.h> - -#if _MIPS_SIM == _ABIO32 - -#define SIGCONTEXT unsigned long _code, struct sigcontext * -#define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->sc_pc) -#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30]) -#define GET_STACK(ctx) ((void *) ctx->sc_regs[29]) -#define CALL_SIGHANDLER(handler, signo, ctx) \ - (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) - -#else - -#define SIGCONTEXT unsigned long _code, ucontext_t * -#define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc) -#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30]) -#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29]) -#define CALL_SIGHANDLER(handler, signo, ctx) \ - (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) - -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h deleted file mode 100644 index a93e1fb6d1..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_CACHECTL_H -#define _SYS_CACHECTL_H 1 - -#include <features.h> - -/* - * Get the kernel definition for the op bits. - */ -#include <asm/cachectl.h> - -__BEGIN_DECLS - -#ifdef __USE_MISC -extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW; -#endif -extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW; -#ifdef __USE_MISC -extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW; -#endif -extern int _flush_cache (char *addr, __const int nbytes, __const int op) __THROW; - -__END_DECLS - -#endif /* sys/cachectl.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/procfs.h b/sysdeps/unix/sysv/linux/mips/sys/procfs.h deleted file mode 100644 index 2bf07be3e9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/procfs.h +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_PROCFS_H -#define _SYS_PROCFS_H 1 - -/* This is somehow modelled after the file of the same name on SysVr4 - systems. It provides a definition of the core file format for ELF - used on Linux. */ - -#include <features.h> -#include <sgidefs.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/user.h> -#include <sgidefs.h> - -/* ELF register definitions */ -#define ELF_NGREG 45 -#define ELF_NFPREG 33 - -#if _MIPS_SIM == _ABIN32 -__extension__ typedef unsigned long long elf_greg_t; -#else -typedef unsigned long elf_greg_t; -#endif -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef double elf_fpreg_t; -typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; - -__BEGIN_DECLS - -struct elf_siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - }; - - -/* Definitions to generate Intel SVR4-like core files. These mostly - have the same names as the SVR4 types with "elf_" tacked on the - front to prevent clashes with linux definitions, and the typedef - forms have been avoided. This is mostly like the SVR4 structure, - but more Linuxy, with things that Linux does not support and which - gdb doesn't really use excluded. Fields present but not used are - marked with "XXX". */ -struct elf_prstatus - { - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ -#if _MIPS_SIM == _ABIN32 - __extension__ unsigned long long int pr_sigpend; - __extension__ unsigned long long int pr_sighold; -#else - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ -#endif - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ - elf_gregset_t pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -#define ELF_PRARGSZ (80) /* Number of chars for args */ - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ -#if _MIPS_SIM == _ABIN32 - __extension__ unsigned long long int pr_flag; -#else - unsigned long int pr_flag; /* Flags. */ -#endif - long pr_uid; - long pr_gid; - int pr_pid, pr_ppid, pr_pgrp, pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ - }; - - -/* Addresses. */ -typedef void *psaddr_t; - -/* Register sets. Linux has different names. */ -typedef elf_gregset_t prgregset_t; -typedef elf_fpregset_t prfpregset_t; - -/* We don't have any differences between processes and threads, - therefore habe only ine PID type. */ -typedef __pid_t lwpid_t; - - -typedef struct elf_prstatus prstatus_t; -typedef struct elf_prpsinfo prpsinfo_t; - -__END_DECLS - -#endif /* sys/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/ptrace.h b/sysdeps/unix/sysv/linux/mips/sys/ptrace.h deleted file mode 100644 index d05853da77..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/ptrace.h +++ /dev/null @@ -1,136 +0,0 @@ -/* `ptrace' debugger support interface. Linux version. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_PTRACE_H -#define _SYS_PTRACE_H 1 - -#include <features.h> -#include <sgidefs.h> - -__BEGIN_DECLS - -/* Type of the REQUEST argument to `ptrace.' */ -enum __ptrace_request -{ - /* Indicate that the process making this request should be traced. - All signals received by this process can be intercepted by its - parent, and its parent can use the other `ptrace' requests. */ - PTRACE_TRACEME = 0, -#define PT_TRACE_ME PTRACE_TRACEME - - /* Return the word in the process's text space at address ADDR. */ - PTRACE_PEEKTEXT = 1, -#define PT_READ_I PTRACE_PEEKTEXT - - /* Return the word in the process's data space at address ADDR. */ - PTRACE_PEEKDATA = 2, -#define PT_READ_D PTRACE_PEEKDATA - - /* Return the word in the process's user area at offset ADDR. */ - PTRACE_PEEKUSER = 3, -#define PT_READ_U PTRACE_PEEKUSER - - /* Write the word DATA into the process's text space at address ADDR. */ - PTRACE_POKETEXT = 4, -#define PT_WRITE_I PTRACE_POKETEXT - - /* Write the word DATA into the process's data space at address ADDR. */ - PTRACE_POKEDATA = 5, -#define PT_WRITE_D PTRACE_POKEDATA - - /* Write the word DATA into the process's user area at offset ADDR. */ - PTRACE_POKEUSER = 6, -#define PT_WRITE_U PTRACE_POKEUSER - - /* Continue the process. */ - PTRACE_CONT = 7, -#define PT_CONTINUE PTRACE_CONT - - /* Kill the process. */ - PTRACE_KILL = 8, -#define PT_KILL PTRACE_KILL - - /* Single step the process. - This is not supported on all machines. */ - PTRACE_SINGLESTEP = 9, -#define PT_STEP PTRACE_SINGLESTEP - - /* Get all general purpose registers used by a processes. - This is not supported on all machines. */ - PTRACE_GETREGS = 12, -#define PT_GETREGS PTRACE_GETREGS - - /* Set all general purpose registers used by a processes. - This is not supported on all machines. */ - PTRACE_SETREGS = 13, -#define PT_SETREGS PTRACE_SETREGS - - /* Get all floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_GETFPREGS = 14, -#define PT_GETFPREGS PTRACE_GETFPREGS - - /* Set all floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_SETFPREGS = 15, -#define PT_SETFPREGS PTRACE_SETFPREGS - - /* Attach to a process that is already running. */ - PTRACE_ATTACH = 16, -#define PT_ATTACH PTRACE_ATTACH - - /* Detach from a process attached to with PTRACE_ATTACH. */ - PTRACE_DETACH = 17, -#define PT_DETACH PTRACE_DETACH - - /* Get all extended floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_GETFPXREGS = 18, -#define PT_GETFPXREGS PTRACE_GETFPXREGS - - /* Set all extended floating point registers used by a processes. - This is not supported on all machines. */ - PTRACE_SETFPXREGS = 19, -#define PT_SETFPXREGS PTRACE_SETFPXREGS - - /* Continue and stop at the next (return from) syscall. */ - PTRACE_SYSCALL = 24 -#define PT_SYSCALL PTRACE_SYSCALL -}; - -/* Perform process tracing functions. REQUEST is one of the values - above, and determines the action to be taken. - For all requests except PTRACE_TRACEME, PID specifies the process to be - traced. - - PID and the other arguments described above for the various requests should - appear (those that are used for the particular request) as: - pid_t PID, void *ADDR, int DATA, void *ADDR2 - after REQUEST. */ -#if _MIPS_SIM == _ABIN32 -__extension__ extern long long int ptrace - (enum __ptrace_request __request, ...) __THROW; -#else -extern long int ptrace (enum __ptrace_request __request, ...) __THROW; -#endif - -__END_DECLS - -#endif /* _SYS_PTRACE_H */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/syscall.h b/sysdeps/unix/sysv/linux/mips/sys/syscall.h deleted file mode 100644 index f6458cd316..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/syscall.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYSCALL_H -#define _SYSCALL_H 1 - -/* This file should list the numbers of the system the system knows. - But instead of duplicating this we use the information available - from the kernel sources. */ -#ifdef _LIBC -/* Since the kernel doesn't define macro names in a way usable for - glibc, we preprocess this header, and use it during the glibc build - process. */ -# include <asm-unistd.h> -#else -# include <asm/unistd.h> -#endif - -#ifndef _LIBC -/* The Linux kernel header file defines macros `__NR_<name>', but some - programs expect the traditional form `SYS_<name>'. So in building libc - we scan the kernel's list and produce <bits/syscall.h> with macros for - all the `SYS_' names. */ -# include <bits/syscall.h> -#endif - -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h deleted file mode 100644 index 0677cafaa4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_SYSMIPS_H -#define _SYS_SYSMIPS_H 1 - -#include <features.h> - -/* - * Commands for the sysmips(2) call - * - * sysmips(2) is deprecated - though some existing software uses it. - * We only support the following commands. Sysmips exists for compatibility - * purposes only so new software should avoid it. - */ -#define SETNAME 1 /* set hostname */ -#define FLUSH_CACHE 3 /* writeback and invalidate caches */ -#define MIPS_FIXADE 7 /* control address error fixing */ -#define MIPS_RDNVRAM 10 /* read NVRAM */ -#define MIPS_ATOMIC_SET 2001 /* atomically set variable */ - -__BEGIN_DECLS - -extern int sysmips (__const int cmd, ...) __THROW; - -__END_DECLS - -#endif /* sys/sysmips.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h deleted file mode 100644 index 1183b867b8..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/tas.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_TAS_H -#define _SYS_TAS_H 1 - -#include <features.h> -#include <sgidefs.h> - -__BEGIN_DECLS - -extern int _test_and_set (int *p, int v) __THROW; - -#ifdef __USE_EXTERN_INLINES - -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif - -_EXTERN_INLINE int -__NTH (_test_and_set (int *p, int v)) -{ - int r, t; - - __asm__ __volatile__ - ("/* Inline test and set */\n" - "1:\n\t" - ".set push\n\t" -#if _MIPS_SIM == _ABIO32 - ".set mips2\n\t" -#endif - "ll %0,%3\n\t" - "move %1,%4\n\t" - "beq %0,%4,2f\n\t" - "sc %1,%2\n\t" - ".set pop\n\t" - "beqz %1,1b\n" - "2:\n\t" - "/* End test and set */" - : "=&r" (r), "=&r" (t), "=m" (*p) - : "m" (*p), "r" (v) - : "memory"); - - return r; -} - -#endif /* __USE_EXTERN_INLINES */ - -__END_DECLS - -#endif /* sys/tas.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h deleted file mode 100644 index ddb499f20c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Don't rely on this, the interface is currently messed up and may need to - be broken to be fixed. */ -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include <features.h> -#include <sgidefs.h> -#include <signal.h> - -/* We need the signal context definitions even if they are not used - included in <signal.h>. */ -#include <bits/sigcontext.h> - -/* Type for general register. Even in o32 we assume 64-bit registers, - like the kernel. */ -__extension__ typedef unsigned long long int greg_t; - -/* Number of general registers. */ -#define NGREG 32 -#define NFPREG 32 - -/* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; - -/* Container for all FPU registers. */ -typedef struct fpregset { - union { - double fp_dregs[NFPREG]; - struct { - float _fp_fregs; - unsigned int _fp_pad; - } fp_fregs[NFPREG]; - } fp_r; -} fpregset_t; - - -/* Context to describe whole processor state. */ -#if _MIPS_SIM == _ABIO32 -/* Earlier versions of glibc for mips had an entirely different - definition of mcontext_t, that didn't even resemble the - corresponding kernel data structure. Since all legitimate uses of - ucontext_t in glibc mustn't have accessed anything beyond - uc_mcontext and, even then, taking a pointer to it, casting it to - sigcontext_t, and accessing it as such, which is what it has always - been, this can still be rectified. Fortunately, makecontext, - [gs]etcontext et all have never been implemented. */ -typedef struct - { - unsigned int regmask; - unsigned int status; - greg_t pc; - gregset_t gregs; - fpregset_t fpregs; - unsigned int fp_owned; - unsigned int fpc_csr; - unsigned int fpc_eir; - unsigned int used_math; - unsigned int ssflags; - greg_t mdhi; - greg_t mdlo; - unsigned int cause; - unsigned int badvaddr; - } mcontext_t; -#else -typedef struct - { - gregset_t gregs; - fpregset_t fpregs; - greg_t mdhi; - greg_t mdlo; - greg_t pc; - unsigned int status; - unsigned int fpc_csr; - unsigned int fpc_eir; - unsigned int used_math; - unsigned int cause; - unsigned int badvaddr; - } mcontext_t; -#endif - -/* Userlevel context. */ -typedef struct ucontext - { - unsigned long int uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - __sigset_t uc_sigmask; - } ucontext_t; - -#endif /* sys/ucontext.h */ diff --git a/sysdeps/unix/sysv/linux/mips/sys/user.h b/sysdeps/unix/sysv/linux/mips/sys/user.h deleted file mode 100644 index d5b3b0508b..0000000000 --- a/sysdeps/unix/sysv/linux/mips/sys/user.h +++ /dev/null @@ -1,219 +0,0 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_USER_H -#define _SYS_USER_H 1 - -#include <sgidefs.h> - -/* The whole purpose of this file is for GDB and GDB only. Don't read - too much into it. Don't use it for anything other than GDB unless - you know what you are doing. */ - -/* #include <asm/reg.h> */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste its - contents here. Note that the fact that the file is inline here, - instead of included separately, doesn't change in any way the - licensing status of a program that includes user.h. Since this is - for gdb alone, and gdb is GPLed, no surprises here. */ -#if _MIPS_SIM == _ABIO32 -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 by Ralf Baechle - */ -#ifndef __ASM_MIPS_REG_H -#define __ASM_MIPS_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 6 -#define EF_REG1 7 -#define EF_REG2 8 -#define EF_REG3 9 -#define EF_REG4 10 -#define EF_REG5 11 -#define EF_REG6 12 -#define EF_REG7 13 -#define EF_REG8 14 -#define EF_REG9 15 -#define EF_REG10 16 -#define EF_REG11 17 -#define EF_REG12 18 -#define EF_REG13 19 -#define EF_REG14 20 -#define EF_REG15 21 -#define EF_REG16 22 -#define EF_REG17 23 -#define EF_REG18 24 -#define EF_REG19 25 -#define EF_REG20 26 -#define EF_REG21 27 -#define EF_REG22 28 -#define EF_REG23 29 -#define EF_REG24 30 -#define EF_REG25 31 -/* - * k0/k1 unsaved - */ -#define EF_REG28 34 -#define EF_REG29 35 -#define EF_REG30 36 -#define EF_REG31 37 - -/* - * Saved special registers - */ -#define EF_LO 38 -#define EF_HI 39 - -#define EF_CP0_EPC 40 -#define EF_CP0_BADVADDR 41 -#define EF_CP0_STATUS 42 -#define EF_CP0_CAUSE 43 - -#define EF_SIZE 180 /* size in bytes */ - -#endif /* __ASM_MIPS_REG_H */ - -#else /* _MIPS_SIM != _ABIO32 */ - -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 Ralf Baechle - * Copyright (C) 1995, 1999 Silicon Graphics - */ -#ifndef _ASM_REG_H -#define _ASM_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 0 -#define EF_REG1 1 -#define EF_REG2 2 -#define EF_REG3 3 -#define EF_REG4 4 -#define EF_REG5 5 -#define EF_REG6 6 -#define EF_REG7 7 -#define EF_REG8 8 -#define EF_REG9 9 -#define EF_REG10 10 -#define EF_REG11 11 -#define EF_REG12 12 -#define EF_REG13 13 -#define EF_REG14 14 -#define EF_REG15 15 -#define EF_REG16 16 -#define EF_REG17 17 -#define EF_REG18 18 -#define EF_REG19 19 -#define EF_REG20 20 -#define EF_REG21 21 -#define EF_REG22 22 -#define EF_REG23 23 -#define EF_REG24 24 -#define EF_REG25 25 -/* - * k0/k1 unsaved - */ -#define EF_REG28 28 -#define EF_REG29 29 -#define EF_REG30 30 -#define EF_REG31 31 - -/* - * Saved special registers - */ -#define EF_LO 32 -#define EF_HI 33 - -#define EF_CP0_EPC 34 -#define EF_CP0_BADVADDR 35 -#define EF_CP0_STATUS 36 -#define EF_CP0_CAUSE 37 - -#define EF_SIZE 304 /* size in bytes */ - -#endif /* _ASM_REG_H */ - -#endif /* _MIPS_SIM != _ABIO32 */ - -#if _MIPS_SIM == _ABIO32 - -struct user -{ - unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - void* u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#else - -struct user { - __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ - __extension__ unsigned long u_tsize; /* text size (pages) */ - __extension__ unsigned long u_dsize; /* data size (pages) */ - __extension__ unsigned long u_ssize; /* stack size (pages) */ - __extension__ unsigned long long start_code; /* text starting address */ - __extension__ unsigned long long start_data; /* data starting address */ - __extension__ unsigned long long start_stack; /* stack starting address */ - __extension__ long long signal; /* signal causing core dump */ - __extension__ unsigned long long u_ar0; /* help gdb find registers */ - __extension__ unsigned long long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#endif - -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_DATA_START_ADDR (u.start_data) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif /* _SYS_USER_H */ diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list deleted file mode 100644 index 518f2a2522..0000000000 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ /dev/null @@ -1,31 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -# -# Calls for compatibility with existing MIPS OS implementations and -# compilers. -# -cachectl - cachectl i:pii __cachectl cachectl -cacheflush - cacheflush i:pii _flush_cache cacheflush -sysmips - sysmips i:iiii __sysmips sysmips - -# -# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; -# it's provided for compatibility, though. -# -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect_internal __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/mips/truncate64.c b/sysdeps/unix/sysv/linux/mips/truncate64.c deleted file mode 100644 index 01cc148be9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/truncate64.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <sys/types.h> -#include <endian.h> -#include <errno.h> -#include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -#include <kernel-features.h> - -#ifdef __NR_truncate64 -#ifndef __ASSUME_TRUNCATE64_SYSCALL -/* The variable is shared between all wrappers around *truncate64 calls. */ -int __have_no_truncate64; -#endif - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -truncate64 (const char *path, off64_t length) -{ -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (! __have_no_truncate64) -#endif - { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; -#ifndef __ASSUME_TRUNCATE64_SYSCALL - int saved_errno = errno; -#endif - int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0, - __LONG_LONG_PAIR (high, low)); -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if (result != -1 || errno != ENOSYS) -#endif - return result; - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - __set_errno (saved_errno); - __have_no_truncate64 = 1; -#endif - } - -#ifndef __ASSUME_TRUNCATE64_SYSCALL - if ((off_t) length != length) - { - __set_errno (EINVAL); - return -1; - } - return truncate (path, (off_t) length); -#endif -} - -#else -/* Use the generic implementation. */ -# include <misc/truncate64.c> -#endif diff --git a/sysdeps/unix/sysv/linux/mips/ustat.c b/sysdeps/unix/sysv/linux/mips/ustat.c deleted file mode 100644 index a309f7104c..0000000000 --- a/sysdeps/unix/sysv/linux/mips/ustat.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <sys/ustat.h> -#include <sys/sysmacros.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -int -ustat (dev_t dev, struct ustat *ubuf) -{ - unsigned long k_dev; - - /* We must convert the value to dev_t type used by the kernel. */ - k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); - - return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf)); -} diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S deleted file mode 100644 index 38b6195282..0000000000 --- a/sysdeps/unix/sysv/linux/mips/vfork.S +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* vfork() is just a special case of clone(). */ - -#include <sys/asm.h> -#include <sysdep.h> -#include <asm/unistd.h> -#include <sgidefs.h> - -#ifndef SAVE_PID -#define SAVE_PID -#endif - -#ifndef RESTORE_PID -#define RESTORE_PID -#endif - - -/* int vfork() */ - - .text -LOCALSZ= 1 -FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK -GPOFF= FRAMESZ-(1*SZREG) -NESTED(__vfork,FRAMESZ,sp) -#ifdef __PIC__ - SETUP_GP -#endif - PTR_SUBU sp, FRAMESZ - SETUP_GP64 (a5, __vfork) -#ifdef __PIC__ - SAVE_GP (GPOFF) -#endif -#ifdef PROF -# if (_MIPS_SIM != _ABIO32) - PTR_S a5, GPOFF(sp) -# endif - .set noat - move $1, ra -# if (_MIPS_SIM == _ABIO32) - subu sp,sp,8 -# endif - jal _mcount - .set at -# if (_MIPS_SIM != _ABIO32) - PTR_L a5, GPOFF(sp) -# endif -#endif - - PTR_ADDU sp, FRAMESZ - - SAVE_PID - - li a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */ - move a1, sp - - /* Do the system call */ - li v0,__NR_clone - syscall - - RESTORE_PID - - bnez a3,L(error) - - /* Successful return from the parent or child. */ - RESTORE_GP64 - ret - - /* Something bad happened -- no child created. */ -L(error): -#ifdef __PIC__ - PTR_LA t9, __syscall_error - RESTORE_GP64 - jr t9 -#else - RESTORE_GP64 - j __syscall_error -#endif - END(__vfork) - -libc_hidden_def(__vfork) -weak_alias (__vfork, vfork) diff --git a/sysdeps/unix/sysv/linux/mips/xmknod.c b/sysdeps/unix/sysv/linux/mips/xmknod.c deleted file mode 100644 index 2d09752405..0000000000 --- a/sysdeps/unix/sysv/linux/mips/xmknod.c +++ /dev/null @@ -1,51 +0,0 @@ -/* xmknod call using old-style Unix mknod system call. - Copyright (C) 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2002, 2003 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/sysmacros.h> - -#include <sysdep.h> -#include <sys/syscall.h> -#include <bp-checks.h> - -/* Create a device file named PATH, with permission and special bits MODE - and device number DEV (which can be constructed from major and minor - device numbers with the `makedev' macro above). */ -int -__xmknod (int vers, const char *path, mode_t mode, dev_t *dev) -{ - unsigned long k_dev; - - if (vers != _MKNOD_VER) - { - __set_errno (EINVAL); - return -1; - } - - /* We must convert the value to dev_t type used by the kernel. */ - k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff); - - return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev); -} - -weak_alias (__xmknod, _xmknod) -libc_hidden_def (__xmknod) diff --git a/sysdeps/unix/sysv/linux/mips/xstatconv.c b/sysdeps/unix/sysv/linux/mips/xstatconv.c deleted file mode 100644 index 41d1cbb768..0000000000 --- a/sysdeps/unix/sysv/linux/mips/xstatconv.c +++ /dev/null @@ -1,133 +0,0 @@ -/* Convert between the kernel's `struct stat' format, and libc's. - Copyright (C) 1991,1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <errno.h> -#include <sys/stat.h> -#include <kernel_stat.h> - -#ifdef STAT_IS_KERNEL_STAT - -/* Dummy. */ -struct kernel_stat; - -#else - -#include <string.h> - - -int -__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) -{ - switch (vers) - { - case _STAT_VER_KERNEL: - /* Nothing to do. The struct is in the form the kernel expects. - We should have short-circuted before we got here, but for - completeness... */ - *(struct kernel_stat *) ubuf = *kbuf; - break; - - case _STAT_VER_LINUX: - { - struct stat *buf = ubuf; - - /* Convert to current kernel version of `struct stat'. */ - buf->st_dev = kbuf->st_dev; - buf->st_pad1[0] = 0; buf->st_pad1[1] = 0; buf->st_pad1[2] = 0; - buf->st_ino = kbuf->st_ino; - buf->st_mode = kbuf->st_mode; - buf->st_nlink = kbuf->st_nlink; - buf->st_uid = kbuf->st_uid; - buf->st_gid = kbuf->st_gid; - buf->st_rdev = kbuf->st_rdev; - buf->st_pad2[0] = 0; buf->st_pad2[1] = 0; - buf->st_pad3 = 0; - buf->st_size = kbuf->st_size; - buf->st_blksize = kbuf->st_blksize; - buf->st_blocks = kbuf->st_blocks; - - buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0; - buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0; - buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0; - - buf->st_pad5[0] = 0; buf->st_pad5[1] = 0; - buf->st_pad5[2] = 0; buf->st_pad5[3] = 0; - buf->st_pad5[4] = 0; buf->st_pad5[5] = 0; - buf->st_pad5[6] = 0; buf->st_pad5[7] = 0; - } - break; - - default: - __set_errno (EINVAL); - return -1; - } - - return 0; -} - -int -__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf) -{ -#ifdef XSTAT_IS_XSTAT64 - return xstat_conv (vers, kbuf, ubuf); -#else - switch (vers) - { - case _STAT_VER_LINUX: - { - struct stat64 *buf = ubuf; - - buf->st_dev = kbuf->st_dev; - buf->st_pad1[0] = 0; buf->st_pad1[1] = 0; buf->st_pad1[2] = 0; - buf->st_ino = kbuf->st_ino; - buf->st_mode = kbuf->st_mode; - buf->st_nlink = kbuf->st_nlink; - buf->st_uid = kbuf->st_uid; - buf->st_gid = kbuf->st_gid; - buf->st_rdev = kbuf->st_rdev; - buf->st_pad2[0] = 0; buf->st_pad2[1] = 0; buf->st_pad2[2] = 0; - buf->st_pad3 = 0; - buf->st_size = kbuf->st_size; - buf->st_blksize = kbuf->st_blksize; - buf->st_blocks = kbuf->st_blocks; - - buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0; - buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0; - buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0; - - buf->st_pad4[0] = 0; buf->st_pad4[1] = 0; - buf->st_pad4[2] = 0; buf->st_pad4[3] = 0; - buf->st_pad4[4] = 0; buf->st_pad4[5] = 0; - buf->st_pad4[6] = 0; buf->st_pad4[7] = 0; - } - break; - - /* If struct stat64 is different from struct stat then - _STAT_VER_KERNEL does not make sense. */ - case _STAT_VER_KERNEL: - default: - __set_errno (EINVAL); - return -1; - } - - return 0; -#endif -} - -#endif /* ! STAT_IS_KERNEL_STAT */ |