Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2004-11-05  Maciej W. Rozycki  <macro@mips.com>

	* sysdeps/mips/dl-machine.h: Include <sgidefs.h>.  Use _ABIO32,
	_ABIN32 and _ABI64 for ABI selection throughout.
	* sysdeps/mips/elf/start.S: Likewise.
	* sysdeps/mips/mips64/__longjmp.c: Likewise.
	* sysdeps/mips/mips64/bsd-_setjmp.S: Likewise.
	* sysdeps/mips/mips64/bsd-setjmp.S: Likewise.
	* sysdeps/mips/mips64/setjmp.S: Likewise.
	* sysdeps/mips/mips64/setjmp_aux.c: Likewise.
	* sysdeps/mips/sys/regdef.h: Likewise.
	* sysdeps/mips/sys/ucontext.h: Likewise.
	* sysdeps/unix/mips/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/kernel-features.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/ptrace.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.

	* sysdeps/mips/atomicity.h: Use _ABIO32, _ABIN32 and _ABI64 for
	ABI selection throughout.
	* sysdeps/mips/bits/setjmp.h: Likewise.
	* sysdeps/mips/fpu/bits/mathdef.h: Likewise.
	* sysdeps/mips/machine-gmon.h: Likewise.
	* sysdeps/mips/sys/asm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/ptrace.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/user.h: Likewise.

	* sysdeps/mips/sgidefs.h: Prevent <asm/sgidefs.h> from being 
	included by kernel headers and undo its settings if already 
	included.  Define _ABIO32, _ABIN32 and _ABI64 if missing and use 
	them to define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32 and 
	_MIPS_SIM_ABI64 for compatibility.
	* sysdeps/unix/sysv/linux/mips/Makefile: Use _ABIO32, _ABIN32 and
	_ABI64 for ABI selection in generated syscall-list.h
	* sysdeps/unix/sysv/linux/mips/configure.in: Use _ABIO32, _ABIN32
	and _ABI64 for ABI selection in generated asm-unistd.h.
	* sysdeps/unix/sysv/linux/mips/configure: Regenerate.

	* sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Correct
	an inverted _MIPS_SIM conditional.
  • Loading branch information
Andreas Jaeger committed Nov 24, 2004
1 parent cdb7b96 commit c997e9d
Show file tree
Hide file tree
Showing 37 changed files with 214 additions and 107 deletions.
52 changes: 52 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
2004-11-05 Maciej W. Rozycki <macro@mips.com>

* sysdeps/mips/dl-machine.h: Include <sgidefs.h>. Use _ABIO32,
_ABIN32 and _ABI64 for ABI selection throughout.
* sysdeps/mips/elf/start.S: Likewise.
* sysdeps/mips/mips64/__longjmp.c: Likewise.
* sysdeps/mips/mips64/bsd-_setjmp.S: Likewise.
* sysdeps/mips/mips64/bsd-setjmp.S: Likewise.
* sysdeps/mips/mips64/setjmp.S: Likewise.
* sysdeps/mips/mips64/setjmp_aux.c: Likewise.
* sysdeps/mips/sys/regdef.h: Likewise.
* sysdeps/mips/sys/ucontext.h: Likewise.
* sysdeps/unix/mips/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h: Likewise.
* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/ptrace.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/procfs.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.

* sysdeps/mips/atomicity.h: Use _ABIO32, _ABIN32 and _ABI64 for
ABI selection throughout.
* sysdeps/mips/bits/setjmp.h: Likewise.
* sysdeps/mips/fpu/bits/mathdef.h: Likewise.
* sysdeps/mips/machine-gmon.h: Likewise.
* sysdeps/mips/sys/asm.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/user.h: Likewise.

* sysdeps/mips/sgidefs.h: Prevent <asm/sgidefs.h> from being
included by kernel headers and undo its settings if already
included. Define _ABIO32, _ABIN32 and _ABI64 if missing and use
them to define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32 and
_MIPS_SIM_ABI64 for compatibility.
* sysdeps/unix/sysv/linux/mips/Makefile: Use _ABIO32, _ABIN32 and
_ABI64 for ABI selection in generated syscall-list.h
* sysdeps/unix/sysv/linux/mips/configure.in: Use _ABIO32, _ABIN32
and _ABI64 for ABI selection in generated asm-unistd.h.
* sysdeps/unix/sysv/linux/mips/configure: Regenerate.

* sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Correct
an inverted _MIPS_SIM conditional.

2004-11-23 Alexandre Oliva <aoliva@redhat.com>

* sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Use free
Expand Down
7 changes: 7 additions & 0 deletions linuxthreads/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2004-11-05 Maciej W. Rozycki <macro@mips.com>

* sysdeps/mips/pspinlock.c: Include <sgidefs.h>. Use _ABIO32,
_ABIN32 and _ABI64 for ABI selection throughout.
* sysdeps/mips/pt-machine.h: Use _ABIO32, _ABIN32 and _ABI64 for
ABI selection throughout.

2004-10-18 Roland McGrath <roland@redhat.com>

[BZ #406]
Expand Down
10 changes: 5 additions & 5 deletions sysdeps/mips/atomicity.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
("/* Inline exchange & add */\n"
"1:\n\t"
".set push\n\t"
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
"ll %0,%3\n\t"
Expand All @@ -59,7 +59,7 @@ atomic_add (volatile uint32_t *mem, int val)
("/* Inline atomic add */\n"
"1:\n\t"
".set push\n\t"
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
"ll %0,%2\n\t"
Expand All @@ -83,18 +83,18 @@ compare_and_swap (volatile long int *p, long int oldval, long int newval)
("/* Inline compare & swap */\n"
"1:\n\t"
".set push\n\t"
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if _MIPS_SIM == _ABI64
"lld %1,%5\n\t"
#else
"ll %1,%5\n\t"
#endif
"move %0,$0\n\t"
"bne %1,%3,2f\n\t"
"move %0,%4\n\t"
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if _MIPS_SIM == _ABI64
"scd %0,%2\n\t"
#else
"sc %0,%2\n\t"
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/mips/bits/setjmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

typedef struct
{
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
/* Program counter. */
__ptr_t __pc;

Expand Down Expand Up @@ -62,7 +62,7 @@ typedef struct
int __fpc_csr;

/* Callee-saved floating point registers. */
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if _MIPS_SIM == _ABI64
double __fpregs[8];
#else
double __fpregs[6];
Expand Down
16 changes: 8 additions & 8 deletions sysdeps/mips/dl-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#error ENTRY_POINT needs to be defined for MIPS.
#endif

#include <sgidefs.h>
#include <sys/asm.h>

/* The offset of gp from GOT might be system-dependent. It's set by
Expand Down Expand Up @@ -74,10 +75,9 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
static inline int __attribute_used__
elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
{
#if _MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _MIPS_SIM_NABI32
#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32
/* Don't link o32 and n32 together. */
if (((ehdr->e_flags & EF_MIPS_ABI2) != 0)
!= (_MIPS_SIM != _MIPS_SIM_ABI32))
if (((ehdr->e_flags & EF_MIPS_ABI2) != 0) != (_MIPS_SIM == _ABIN32))
return 0;
#endif

Expand Down Expand Up @@ -130,7 +130,7 @@ elf_machine_load_address (void)
}

/* The MSB of got[1] of a gnu object is set to identify gnu objects. */
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if _MIPS_SIM == _ABI64
# define ELF_MIPS_GNU_GOT1_MASK 0x8000000000000000L
#else
# define ELF_MIPS_GNU_GOT1_MASK 0x80000000L
Expand Down Expand Up @@ -257,7 +257,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)
return NULL;
}

#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
#define ELF_DL_FRAME_SIZE 40

#define ELF_DL_SAVE_ARG_REGS "\
Expand All @@ -278,7 +278,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)

#define IFABIO32(X) X

#else /* _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64 */
#else /* _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 */

#define ELF_DL_FRAME_SIZE 80

Expand Down Expand Up @@ -550,7 +550,7 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,

switch (r_type)
{
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if _MIPS_SIM == _ABI64
case (R_MIPS_64 << 8) | R_MIPS_REL32:
#else
case R_MIPS_REL32:
Expand Down Expand Up @@ -615,7 +615,7 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
break;
case R_MIPS_NONE: /* Alright, Wilbur. */
break;
#if _MIPS_SIM == _MIPS_SIM_ABI64
#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
Expand Down
7 changes: 4 additions & 3 deletions sysdeps/mips/elf/start.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF Mips ABI.
Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003
Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -37,6 +37,7 @@

#define __ASSEMBLY__ 1
#include <entry.h>
#include <sgidefs.h>
#include <sys/asm.h>

#ifndef ENTRY_POINT
Expand Down Expand Up @@ -93,12 +94,12 @@ ENTRY_POINT:
on o32 and quad words (16 bytes) on n32 and n64. */

and $29, -2 * SZREG
#if _MIPS_SIM == _MIPS_SIM_ABI32
#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 == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
PTR_S $8, 16($29) /* fini */
PTR_S $2, 20($29) /* rtld_fini */
PTR_S $29, 24($29) /* stack_end */
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/mips/fpu/bits/mathdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef double double_t; /* `double' expressions are evaluated as

#endif /* ISO C99 */

#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _MIPS_SIM_ABI32
#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
Expand Down
6 changes: 3 additions & 3 deletions sysdeps/mips/machine-gmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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 == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32

#ifdef __PIC__
# define CPLOAD ".cpload $25;"
Expand Down Expand Up @@ -83,10 +83,10 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
# define CPRETURN
#endif

#if _MIPS_SIM == _MIPS_SIM_NABI32
#if _MIPS_SIM == _ABIN32
# define PTR_ADDU_STRING "add" /* no u */
# define PTR_SUBU_STRING "sub" /* no u */
#elif _MIPS_SIM == _MIPS_SIM_ABI64
#elif _MIPS_SIM == _ABI64
# define PTR_ADDU_STRING "daddu"
# define PTR_SUBU_STRING "dsubu"
#else
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/mips/mips64/__longjmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
02111-1307 USA. */

#include <setjmp.h>
#include <sgidefs.h>
#include <stdlib.h>

#undef __longjmp
Expand All @@ -39,7 +40,7 @@ __longjmp (env, val_arg)
register int val asm ("a1");

/* Pull back the floating point callee-saved registers. */
#if _MIPS_SIM == _MIPS_SIM_ABI64
#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]));
Expand Down
6 changes: 4 additions & 2 deletions sysdeps/mips/mips64/bsd-_setjmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version.
Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
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
Expand All @@ -21,6 +22,7 @@
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>

Expand All @@ -33,7 +35,7 @@ ENTRY (_setjmp)
#endif
SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
nop
#endif
RESTORE_GP64
Expand Down
5 changes: 3 additions & 2 deletions sysdeps/mips/mips64/bsd-setjmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version.
Copyright (C) 1996, 1997, 2002, 2003 Free Software Foundation, Inc.
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
Expand All @@ -21,6 +21,7 @@
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>

Expand All @@ -33,7 +34,7 @@ ENTRY (setjmp)
#endif
SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
nop
#endif
RESTORE_GP64
Expand Down
8 changes: 5 additions & 3 deletions sysdeps/mips/mips64/setjmp.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
/* 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
Expand All @@ -16,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <sgidefs.h>
#include <sysdep.h>
#include <sys/asm.h>

Expand All @@ -33,11 +35,11 @@ ENTRY (__sigsetjmp)
move a2, sp
move a3, fp
PTR_LA t9, __sigsetjmp_aux
#if _MIPS_SIM == _MIPS_SIM_ABI32
#if _MIPS_SIM == _ABIO32
nop
#endif
RESTORE_GP64
#if _MIPS_SIM != _MIPS_SIM_ABI32
#if _MIPS_SIM != _ABIO32
move a4, gp
#endif
jr t9
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/mips/mips64/setjmp_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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
Expand All @@ -29,7 +30,7 @@ __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 == _MIPS_SIM_ABI64
#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]));
Expand Down
Loading

0 comments on commit c997e9d

Please sign in to comment.