Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/powerpc/sys Support *__errno() indirection.



details:   https://anonhg.NetBSD.org/src/rev/c2781117e8a8
branches:  trunk
changeset: 481373:c2781117e8a8
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Jan 27 14:58:48 2000 +0000

description:
Support *__errno() indirection.

diffstat:

 lib/libc/arch/powerpc/sys/cerror.S |  23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 04132ccdf990 -r c2781117e8a8 lib/libc/arch/powerpc/sys/cerror.S
--- a/lib/libc/arch/powerpc/sys/cerror.S        Thu Jan 27 09:47:12 2000 +0000
+++ b/lib/libc/arch/powerpc/sys/cerror.S        Thu Jan 27 14:58:48 2000 +0000
@@ -1,12 +1,26 @@
-/*     $NetBSD: cerror.S,v 1.4 1999/01/14 22:48:21 kleink Exp $        */
+/*     $NetBSD: cerror.S,v 1.5 2000/01/27 14:58:48 kleink Exp $        */
 
 #include <machine/asm.h>
 #include "SYS.h"
 
-/* XXX _REENTRANT */
+#ifndef _REENTRANT
+       .globl  _C_LABEL(errno)
+#endif
 
-       .globl  _C_LABEL(errno)
 ENTRY(__cerror)
+#ifdef _REENTRANT
+       mflr    0
+       stwu    1,-16(1)                # allocate new stack frame
+       stw     0,20(1)
+       stw     31,8(1)
+       mr      31,3                    # stash away in callee-saved register
+       bl      PIC_PLT(_C_LABEL(__errno))
+       stw     31,0(3)
+       lwz     0,20(1)
+       lwz     31,8(1)
+       mtlr    0
+       la      1,16(1)
+#else
 #ifdef PIC
        mflr    10
        bl      _GLOBAL_OFFSET_TABLE_@local-4
@@ -17,7 +31,8 @@
 #else
        lis     4,_C_LABEL(errno)@ha
        stw     3,_C_LABEL(errno)@l(4)
-#endif
+#endif /* PIC */
+#endif /* _REENTRANT */
        li      3,-1
        li      4,-1
        blr



Home | Main Index | Thread Index | Old Index