From 44b8acdd3a2f181b415a43e3f7c7dad66b0e4556 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 7 Sep 1996 04:10:03 +0000 Subject: [PATCH] update from main archive 960906 --- sysdeps/alpha/elf/start.S | 1 + sysdeps/unix/alpha/sysdep.S | 56 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/sysdeps/alpha/elf/start.S b/sysdeps/alpha/elf/start.S index d20a009..c8b374a 100644 --- a/sysdeps/alpha/elf/start.S +++ b/sysdeps/alpha/elf/start.S @@ -21,6 +21,7 @@ Cambridge, MA 02139, USA. */ .text .align 3 + .globl _start .ent _start, 0 _start: .frame fp, 0, zero diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/sysdep.S index 336eb02..8d70bda 100644 --- a/sysdeps/unix/alpha/sysdep.S +++ b/sysdeps/unix/alpha/sysdep.S @@ -17,8 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#define _ERRNO_H -#include +#include .section .bss .globl errno @@ -30,15 +29,60 @@ errno: .space 4 #endif .text -LEAF(__syscall_error, 0) + .align 2 + +#ifdef _LIBC_REENTRANT + + .globl __syscall_error + .ent __syscall_error +__syscall_error: ldgp gp, 0(t12) + lda sp, -16(sp) + .frame sp, 16, ra, 0 + stq ra, 0(sp) + stq v0, 8(sp) + .mask 0x4000001, -16 .prologue 1 - /* Store return value in errno... */ - stl v0, errno + /* Find our pre-thread errno address */ + jsr ra, __errno_location + + /* Store the error value. */ + ldl t0, 8(sp) + stl t0, 0(v0) - /* And just kick back a -1. */ + /* And kick back a -1. */ ldi v0, -1 + + ldq ra, 0(sp) + lda sp, 16(sp) ret + .end __syscall_error + +/* A default non-threaded version of __errno_location that just returns + the address of errno. */ + + .weak __errno_location + .ent __errno_location +__errno_location: + .frame sp, 0, ra + ldgp gp, 0(t12) + .mask 0, 0 + .prologue 1 + lda v0, errno + ret + .end __errno_location + +#else + +ENTRY(__syscall_error) + ldgp gp, 0(t12) + .prologue 1 + + stl v0, errno + lda v0, -1 + ret END(__syscall_error) + +#endif /* _LIBC_REENTRANT */ -- 2.7.4