about summary refs log tree commit diff
path: root/sysdeps/unix/alpha/sysdep.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-08 02:20:41 +0000
committerRoland McGrath <roland@gnu.org>2002-11-08 02:20:41 +0000
commitc6481412ff19d5c551aba9330082a19a4a93260f (patch)
tree335acb22df9e06295318ebe74d3dc8d6dac03968 /sysdeps/unix/alpha/sysdep.h
parentdfe4c900cb1d03533702c453c3a9abe6d41e545d (diff)
downloadglibc-c6481412ff19d5c551aba9330082a19a4a93260f.tar.gz
glibc-c6481412ff19d5c551aba9330082a19a4a93260f.tar.xz
glibc-c6481412ff19d5c551aba9330082a19a4a93260f.zip
* configure.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove test.
	* configure: Regenerated.
	* config.h.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove #undef.
	* sysdeps/alpha/dl-machine.h (TRAMPOLINE_TEMPLATE): Use !samegp.
	(RTLD_START): Likewise.  Access _dl_skip_args, _rtld_local, and
	_dl_fini via gp-relative relocations.
	* sysdeps/alpha/fpu/e_sqrt.c: Use !samegp.

	* elf/tls-macros.h: Add alpha versions.
	* sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle TLS relocs.
	* sysdeps/unix/alpha/sysdep.S: Support USE___THREAD.
	* sysdeps/unix/alpha/sysdep.h: Likewise.  Add SYSCALL_ERROR_HANDLER.
	* sysdeps/unix/sysv/linux/alpha/brk.S: Use it.
	* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/getitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.

	* sysdeps/unix/sysv/linux/alpha/sysdep.h: Re-include protect.
	Kill argument registers across the inline syscall.

	* sysdeps/unix/sysv/linux/alpha/clone.S: Add user_tid and tls args.

	* linuxthreads/sysdeps/alpha/tls.h: New file.
	* sysdeps/alpha/dl-tls.h: New file.
Diffstat (limited to 'sysdeps/unix/alpha/sysdep.h')
-rw-r--r--sysdeps/unix/alpha/sysdep.h100
1 files changed, 59 insertions, 41 deletions
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 46b5214987..f9aba3ffa2 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -27,6 +27,13 @@
 # include <regdef.h>
 #endif
 
+#include <tls.h>		/* Defines USE___THREAD.  */
+
+#ifdef IS_IN_rtld
+# include <dl-sysdep.h>         /* Defines RTLD_PRIVATE_ERRNO.  */
+#endif
+
+
 #ifdef __STDC__
 #define __LABEL(x)	x##:
 #else
@@ -55,54 +62,65 @@
    label of that number between those two macros!  */
 
 #ifdef PROF
-#define PSEUDO(name, syscall_name, args)	\
-    .globl name;				\
-    .align 3;					\
-    .ent name,0;				\
+# define PSEUDO_PROLOGUE			\
+	.frame sp, 0, ra;			\
+	ldgp	gp,0(pv);			\
+	.set noat;				\
+	lda	AT,_mcount;			\
+	jsr	AT,(AT),_mcount;		\
+	.set at;				\
+	.prologue 1
+# define PSEUDO_LOADGP
+#else
+# define PSEUDO_PROLOGUE			\
+	.frame sp, 0, ra;			\
+	.prologue 0
+# define PSEUDO_LOADGP				\
+	br	gp, 2f;				\
+2:	ldgp	gp, 0(gp)
+#endif /* PROF */
+
+#if RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER			\
+	stl	v0, errno(gp)	!gprel;		\
+	lda	v0, -1;				\
+	ret
+#else
+# define SYSCALL_ERROR_HANDLER \
+	jmp	$31, __syscall_error
+#endif /* RTLD_PRIVATE_ERRNO */
+
+#if defined(PIC) && !RTLD_PRIVATE_ERRNO
+# define PSEUDO(name, syscall_name, args)	\
+	.globl name;				\
+	.align 4;				\
+	.ent name,0;				\
 __LABEL(name)					\
-    .frame sp, 0, ra;				\
-    ldgp gp,0(pv);				\
-    .set noat;					\
-    lda AT,_mcount;				\
-    jsr AT,(AT),_mcount;			\
-    .set at;					\
-    .prologue 1;				\
-    ldiq	v0, SYS_ify(syscall_name);	\
-    .set noat;					\
-    call_pal	PAL_callsys;			\
-    .set at;					\
-    bne		a3, 1996f;			\
+	PSEUDO_PROLOGUE;			\
+	lda	v0, SYS_ify(syscall_name);	\
+	call_pal PAL_callsys;			\
+	bne	a3, __syscall_error !samegp;	\
 3:
+# undef PSEUDO_END
+# define PSEUDO_END(sym)  END(sym)
 #else
-#define PSEUDO(name, syscall_name, args)	\
-    .globl name;				\
-    .align 3;					\
-    .ent name,0;				\
+# define PSEUDO(name, syscall_name, args)	\
+	.globl name;				\
+	.align 4;				\
+	.ent name,0;				\
 __LABEL(name)					\
-    .frame sp, 0, ra				\
-    .prologue 0;				\
-    ldiq	v0, SYS_ify(syscall_name);	\
-    .set noat;					\
-    call_pal	PAL_callsys;			\
-    .set at;					\
-    bne		a3, 1996f;			\
+	lda	v0, SYS_ify(syscall_name);	\
+	call_pal PAL_callsys;			\
+	bne	a3, 1996f;			\
 3:
-#endif
 
-#undef PSEUDO_END
-#ifdef PROF
-#define PSEUDO_END(sym)				\
+# undef PSEUDO_END
+# define PSEUDO_END(sym)			\
 1996:						\
-    jmp		zero, __syscall_error;		\
-    END(sym)
-#else
-#define PSEUDO_END(sym)				\
-1996:						\
-    br		gp, 2f;				\
-2:  ldgp	gp, 0(gp);			\
-    jmp		zero, __syscall_error;		\
-    END(sym)
-#endif
+	PSEUDO_LOADGP;				\
+	SYSCALL_ERROR_HANDLER;			\
+	END(sym)
+#endif /* PIC && !RTLD_PRIVATE_ERRNO */
 
 #define r0	v0
 #define r1	a4