diff options
| author | Waldemar Brodkorb <wbx@openadk.org> | 2014-09-04 15:18:54 +0200 | 
|---|---|---|
| committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-09-04 15:18:54 +0200 | 
| commit | 36043b37739dffdaea8d31457570810e492268d7 (patch) | |
| tree | 0045cba85b862ecca89cf7b5aff336bddbabad89 /libc/sysdeps/linux/sparc | |
| parent | a5352e212fcd4da83c8ff4fe542ef23c8e3187f8 (diff) | |
| parent | 6d550ddd129b18cf800eab604f74536754526cd8 (diff) | |
Merge remote-tracking branch 'origin/upstream'
Diffstat (limited to 'libc/sysdeps/linux/sparc')
| -rw-r--r-- | libc/sysdeps/linux/sparc/bits/setjmp.h | 31 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/bits/sigcontext.h | 35 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/crt1.S | 11 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/fork.S | 2 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 25 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/pipe.S | 2 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/qp_ops.c | 8 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/clone.S | 101 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/rem.S | 20 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/sdiv.S | 18 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/udiv.S | 15 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/umul.S | 15 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sparcv9/urem.S | 17 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/sys/procfs.h | 88 | ||||
| -rw-r--r-- | libc/sysdeps/linux/sparc/vfork.S | 2 | 
15 files changed, 12 insertions, 378 deletions
| diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h index 5ec4da582..26f62126a 100644 --- a/libc/sysdeps/linux/sparc/bits/setjmp.h +++ b/libc/sysdeps/linux/sparc/bits/setjmp.h @@ -25,37 +25,6 @@  #include <bits/wordsize.h> -#if 0 /*__WORDSIZE == 64*/ - -typedef struct __sparc64_jmp_buf -  { -    struct __sparc64_jmp_buf	*uc_link; -    unsigned long		uc_flags; -    unsigned long		uc_sigmask; -    struct __sparc64_jmp_buf_mcontext -      { -	unsigned long		mc_gregs[19]; -	unsigned long		mc_fp; -	unsigned long		mc_i7; -	struct __sparc64_jmp_buf_fpu -	  { -	    union -	      { -		unsigned int	sregs[32]; -		unsigned long	dregs[32]; -		long double	qregs[16]; -	      }			mcfpu_fpregs; -	    unsigned long	mcfpu_fprs; -	    unsigned long	mcfpu_gsr; -	    void		*mcfpu_fq; -	    unsigned char	mcfpu_qcnt; -	    unsigned char	mcfpu_qentsz; -	    unsigned char	mcfpu_enab; -	  }			mc_fpregs; -      }				uc_mcontext; -  } __jmp_buf[1]; -#else  typedef int __jmp_buf[3]; -#endif  #endif  /* bits/setjmp.h */ diff --git a/libc/sysdeps/linux/sparc/bits/sigcontext.h b/libc/sysdeps/linux/sparc/bits/sigcontext.h index 943548514..251032f33 100644 --- a/libc/sysdeps/linux/sparc/bits/sigcontext.h +++ b/libc/sysdeps/linux/sparc/bits/sigcontext.h @@ -21,8 +21,6 @@  #include <bits/wordsize.h> -#if __WORDSIZE == 32 -  /* It is quite hard to choose what to put here, because     Linux/sparc32 had at least 3 totally incompatible     signal stack layouts. @@ -42,36 +40,3 @@ struct sigcontext      int			si_mask;    }; -#else /* sparc64 */ - -typedef struct -  { -    unsigned int	si_float_regs [64]; -    unsigned long	si_fsr; -    unsigned long	si_gsr; -    unsigned long	si_fprs; -  } __siginfo_fpu_t; - -struct sigcontext -  { -    char		sigc_info[128]; -    struct -      { -	unsigned long	u_regs[16]; /* globals and ins */ -	unsigned long	tstate; -	unsigned long	tpc; -	unsigned long	tnpc; -	unsigned int	y; -	unsigned int	fprs; -      }			sigc_regs; -    __siginfo_fpu_t *	sigc_fpu_save; -    struct -      { -	void *		ss_sp; -	int		ss_flags; -	unsigned long	ss_size; -      }			sigc_stack; -    unsigned long	sigc_mask; -}; - -#endif /* sparc64 */ diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S index 25b5ee59c..77e9147f5 100644 --- a/libc/sysdeps/linux/sparc/crt1.S +++ b/libc/sysdeps/linux/sparc/crt1.S @@ -39,16 +39,9 @@  #include <features.h>  #include <bits/wordsize.h> -/* macro out the 32 / 64 bit differences */ -#if __WORDSIZE == 32  # define STACK_BIAS 0  # define ELE_SIZE 4  # define LD ld -#else -# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */ -# define ELE_SIZE 8 -# define LD ldx -#endif  .text  .align 4 @@ -116,11 +109,7 @@ _start:  	nop  	/* Die very horribly if exit returns.  */ -#if __WORDSIZE == 32  	unimp -#else -	illtrap 0 -#endif  .size _start,.-_start diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S index 8e4bc2265..171591123 100644 --- a/libc/sysdeps/linux/sparc/fork.S +++ b/libc/sysdeps/linux/sparc/fork.S @@ -35,7 +35,7 @@ fork:  	bcc,a	9000f  	nop  	save    %sp,-96,%sp -	call HIDDEN_JUMPTARGET(__errno_location) +	call __errno_location  	nop  	st	%i0,[%o0]  	jmpl	%i7+8,%g0 diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h index 40303f0cd..90efb7719 100644 --- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h +++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h @@ -6,26 +6,19 @@  #include <setjmp.h>  #include <jmpbuf-offsets.h> -#if __WORDSIZE == 64 - -/* Test if longjmp to JMPBUF would unwind the frame -   containing a local variable at ADDRESS.  */ -#define _JMPBUF_UNWINDS(jmpbuf, address) \ -  ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp) - -#else -  /* Test if longjmp to JMPBUF would unwind the frame     containing a local variable at ADDRESS.  */  #define _JMPBUF_UNWINDS(jmpbuf, address) \    ((int) (address) < (jmpbuf)[JB_SP]) -#endif -  #ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#if defined(__arch64__) -#include "sparc64/jmpbuf-unwind.h" -#else -#include "sparc32/jmpbuf-unwind.h" -#endif +#include <setjmp.h> +#include <stdint.h> +#include <unwind.h> + +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ +  _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) + +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ +  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))  #endif diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S index b085fafec..fa77f4d23 100644 --- a/libc/sysdeps/linux/sparc/pipe.S +++ b/libc/sysdeps/linux/sparc/pipe.S @@ -49,7 +49,7 @@ pipe:  	 restore %g0,%g0,%o0  .Lerror: -	call	HIDDEN_JUMPTARGET(__errno_location) +	call	__errno_location  	 or	%g0,EINVAL,%i0  	st	%i0,[%o0]  	ret diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c index 123be53fb..97f98da99 100644 --- a/libc/sysdeps/linux/sparc/qp_ops.c +++ b/libc/sysdeps/linux/sparc/qp_ops.c @@ -1,5 +1,3 @@ -/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */ -  #include <stdio.h>  #include <stdlib.h> @@ -9,11 +7,7 @@ static void fakedef(void)  	exit(-1);  } -#ifdef __sparc_v9__ -# define fakedef(sym) strong_alias(fakedef, _Qp_##sym) -#else  # define fakedef(sym) strong_alias(fakedef, _Q_##sym) -#endif  fakedef(fne)  fakedef(feq) @@ -31,7 +25,6 @@ fakedef(qtos)  fakedef(stoq)  fakedef(itoq)  fakedef(add) -#ifndef __sparc_v9__  fakedef(qtou)  fakedef(utoq)  fakedef(cmp) @@ -44,4 +37,3 @@ fakedef(qtoll)  fakedef(qtoull)  fakedef(sqrt)  fakedef(ulltoq) -#endif diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S deleted file mode 100644 index 2ee62a0f8..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/clone.S +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc. -   This file is part of the GNU C Library. -   Contributed by Richard Henderson (rth@tamu.edu). - -   The GNU C Library is free software; you can redistribute it and/or -   modify it under the terms of the GNU Lesser General Public -   License as published by the Free Software Foundation; either -   version 2.1 of the License, or (at your option) any later version. - -   The GNU C Library is distributed in the hope that it will be useful, -   but WITHOUT ANY WARRANTY; without even the implied warranty of -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -   Lesser General Public License for more details. - -   You should have received a copy of the GNU Lesser General Public -   License along with the GNU C Library; if not, see -   <http://www.gnu.org/licenses/>.  */ - -/* clone() is even more special than fork() as it mucks with stacks -   and invokes a function in the right context after its all over.  */ - -#include <asm/errno.h> -#include <asm/unistd.h> -#include <tcb-offsets.h> -#include <sysdep.h> - -#define CLONE_VM	0x00000100 -#define CLONE_THREAD	0x00010000 - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, -	     pid_t *ptid, void *tls, pid_t *ctid); */ - -	.register	%g2,#scratch -	.register	%g3,#scratch - -	.text - -ENTRY (__clone) -	save	%sp, -192, %sp -	cfi_def_cfa_register(%fp) -	cfi_window_save -	cfi_register(%o7, %i7) - -	/* sanity check arguments */ -	brz,pn	%i0, 99f		/* fn non-NULL? */ -	 mov	%i0, %g2 -	brz,pn	%i1, 99f		/* child_stack non-NULL? */ -	 mov	%i2, %o0		/* clone flags */ - -	/* The child_stack is the top of the stack, allocate one -	   whole stack frame from that as this is what the kernel -	   expects.  Also, subtract STACK_BIAS.  */ -	sub	%i1, 192 + 0x7ff, %o1 -	mov	%i3, %g3 -	mov	%i2, %g4 - -	mov	%i4,%o2			/* PTID */ -	mov	%i5,%o3			/* TLS */ -	ldx	[%fp+0x7ff+176],%o4	/* CTID */ - -	/* Do the system call */ -	set	__NR_clone, %g1 -	ta	0x6d -	bcs,pn	%xcc, 98f -	 nop -	brnz,pn	%o1, __thread_start -	 nop -	jmpl	%i7 + 8, %g0 -	 restore %o0, %g0, %o0 -99:	mov	EINVAL, %o0 -98:	call	HIDDEN_JUMPTARGET(__errno_location) -	 mov	%o0, %i0 -	st	%i0, [%o0] -	jmpl	%i7 + 8, %g0 -	 restore %g0,-1,%o0 -END(__clone) - -	.type __thread_start,@function -__thread_start: -#ifdef RESET_PID -	sethi	%hi(CLONE_THREAD), %l0 -	andcc	%g4, %l0, %g0 -	bne,pt	%icc, 1f -	 andcc	%g4, CLONE_VM, %g0 -	bne,a,pn %icc, 2f -	 mov	-1,%o0 -	set	__NR_getpid,%g1 -	ta	0x6d -2:	st	%o0,[%g7 + PID] -	st	%o0,[%g7 + TID] -1: -#endif -	mov	%g0, %fp	/* terminate backtrace */ -	call	%g2 -	 mov	%g3,%o0 -	call	HIDDEN_JUMPTARGET(_exit),0 -	 nop - -	.size	__thread_start, .-__thread_start - -weak_alias (__clone, clone) diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S deleted file mode 100644 index 1474e32ae..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/rem.S +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Sparc v9 has divide. - * As divx takes 68 cycles and sdivcc only 36, - * we use sdivcc eventhough it is deprecated. - */ - -	.text -	.align		32 -ENTRY(.rem) - -	sra		%o0, 31, %o2 -	wr		%o2, 0, %y -	sdivcc		%o0, %o1, %o2 -	xnor		%o2, %g0, %o3 -	movvs		%icc, %o3, %o2 -	smul		%o2, %o1, %o2 -	retl -	 sub		%o0, %o2, %o0 - -END(.rem) diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S deleted file mode 100644 index 45535bb68..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Sparc v9 has divide. - * As divx takes 68 cycles and sdivcc only 36, - * we use sdivcc eventhough it is deprecated. - */ - -	.text -	.align		32 -ENTRY(.div) - -	sra		%o0, 31, %o2 -	wr		%o2, 0, %y -	sdivcc		%o0, %o1, %o0 -	xnor		%o0, %g0, %o2 -	retl -	 movvs		%icc, %o2, %o0 - -END(.div) diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S deleted file mode 100644 index 303f29bdf..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Sparc v9 has divide. - * As divx takes 68 cycles and udiv only 37, - * we use udiv eventhough it is deprecated. - */ - -	.text -	.align		32 -ENTRY(.udiv) - -	wr		%g0, 0, %y -	retl -	 udiv		%o0, %o1, %o0 - -END(.udiv) diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S deleted file mode 100644 index e65e4b95f..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/umul.S +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Sparc v9 has multiply. - */ - -	.text -	.align		32 -ENTRY(.umul) - -	srl		%o0, 0, %o0 -	srl		%o1, 0, %o1 -	mulx		%o0, %o1, %o0 -	retl -	 srlx		%o0, 32, %o1 - -END(.umul) diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S deleted file mode 100644 index 93542698d..000000000 --- a/libc/sysdeps/linux/sparc/sparcv9/urem.S +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Sparc v9 has divide. - * As divx takes 68 cycles and udiv only 37, - * we use udiv eventhough it is deprecated. - */ - -	.text -	.align		32 -ENTRY(.urem) - -	wr		%g0, 0, %y -	udiv		%o0, %o1, %o2 -	umul		%o2, %o1, %o2 -	retl -	 sub		%o0, %o2, %o0 - -END(.urem) diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h index 37d6a615f..edbd5a5ba 100644 --- a/libc/sysdeps/linux/sparc/sys/procfs.h +++ b/libc/sysdeps/linux/sparc/sys/procfs.h @@ -32,20 +32,6 @@  __BEGIN_DECLS -#if __WORDSIZE == 64 - -#define ELF_NGREG		36 - -typedef struct -  { -    unsigned long	pr_regs[32]; -    unsigned long	pr_fsr; -    unsigned long	pr_gsr; -    unsigned long	pr_fprs; -  } elf_fpregset_t; - -#else /* sparc32 */ -  #define ELF_NGREG		38  typedef struct @@ -63,8 +49,6 @@ typedef struct      unsigned int	pr_q[64];    } elf_fpregset_t; -#endif /* sparc32 */ -  typedef unsigned long elf_greg_t;  typedef elf_greg_t elf_gregset_t[ELF_NGREG]; @@ -110,13 +94,8 @@ struct elf_prpsinfo      char pr_zomb;			/* Zombie.  */      char pr_nice;			/* Nice val.  */      unsigned long int pr_flag;		/* Flags.  */ -#if __WORDSIZE == 64 -    unsigned int pr_uid; -    unsigned int pr_gid; -#else      unsigned short int pr_uid;      unsigned short int pr_gid; -#endif      int pr_pid, pr_ppid, pr_pgrp, pr_sid;      /* Lots missing */      char pr_fname[16];			/* Filename of executable.  */ @@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;  typedef struct elf_prstatus prstatus_t;  typedef struct elf_prpsinfo prpsinfo_t; -#if __WORDSIZE == 64 - -/* Provide 32-bit variants so that BFD can read 32-bit -   core files.  */ -#define ELF_NGREG32		38 -typedef struct -  { -    union -      { -	unsigned int	pr_regs[32]; -	double		pr_dregs[16]; -      }			pr_fr; -    unsigned int	__unused; -    unsigned int	pr_fsr; -    unsigned char	pr_qcnt; -    unsigned char	pr_q_entrysize; -    unsigned char	pr_en; -    unsigned int	pr_q[64]; -  } elf_fpregset_t32; - -typedef unsigned int elf_greg_t32; -typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32]; - -struct elf_prstatus32 -  { -    struct elf_siginfo pr_info;		/* Info associated with signal.  */ -    short int pr_cursig;		/* Current signal.  */ -    unsigned int pr_sigpend;	/* Set of pending signals.  */ -    unsigned int pr_sighold;	/* Set of held signals.  */ -    __pid_t pr_pid; -    __pid_t pr_ppid; -    __pid_t pr_pgrp; -    __pid_t pr_sid; -    struct -      { -	int tv_sec, tv_usec; -      } pr_utime,			/* User time.  */ -        pr_stime,			/* System time.  */ -        pr_cutime,			/* Cumulative user time.  */ -        pr_cstime;			/* Cumulative system time.  */ -    elf_gregset_t32 pr_reg;		/* GP registers.  */ -    int pr_fpvalid;			/* True if math copro being used.  */ -  }; - -struct elf_prpsinfo32 -  { -    char pr_state;			/* Numeric process state.  */ -    char pr_sname;			/* Char for pr_state.  */ -    char pr_zomb;			/* Zombie.  */ -    char pr_nice;			/* Nice val.  */ -    unsigned int pr_flag;		/* Flags.  */ -    unsigned short int pr_uid; -    unsigned short int pr_gid; -    int pr_pid, pr_ppid, pr_pgrp, pr_sid; -    /* Lots missing */ -    char pr_fname[16];			/* Filename of executable.  */ -    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */ -  }; - -typedef elf_gregset_t32 prgregset32_t; -typedef elf_fpregset_t32 prfpregset32_t; - -typedef struct elf_prstatus32 prstatus32_t; -typedef struct elf_prpsinfo32 prpsinfo32_t; - -#endif  /* sparc64 */ -  __END_DECLS  #endif	/* sys/procfs.h */ diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S index 4b701f7ff..e5a3c303d 100644 --- a/libc/sysdeps/linux/sparc/vfork.S +++ b/libc/sysdeps/linux/sparc/vfork.S @@ -37,7 +37,7 @@ __vfork:  	bcc,a	9000f  	nop  	save    %sp,-96,%sp -	call HIDDEN_JUMPTARGET(__errno_location) +	call __errno_location  	nop  	st	%i0,[%o0]  	jmpl	%i7+8,%g0 | 
