Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/11240f474eed
branches:  trunk
changeset: 481209:11240f474eed
user:      kleink <kleink%NetBSD.org@localhost>
date:      Mon Jan 24 21:57:39 2000 +0000

description:
Support *__errno() indirection.

diffstat:

 lib/libc/arch/arm32/sys/cerror.S |  18 ++++++++++++++----
 lib/libc/arch/arm32/sys/ptrace.S |  18 ++++++++++++++----
 2 files changed, 28 insertions(+), 8 deletions(-)

diffs (99 lines):

diff -r 418571ca3991 -r 11240f474eed lib/libc/arch/arm32/sys/cerror.S
--- a/lib/libc/arch/arm32/sys/cerror.S  Mon Jan 24 20:36:06 2000 +0000
+++ b/lib/libc/arch/arm32/sys/cerror.S  Mon Jan 24 21:57:39 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cerror.S,v 1.5 1997/10/17 19:57:17 mark Exp $  */
+/*     $NetBSD: cerror.S,v 1.6 2000/01/24 21:57:39 kleink Exp $        */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -38,6 +38,15 @@
 #include "SYS.h"
 
 ASENTRY(cerror)
+#ifdef _REENTRANT
+       stmfd   sp!, {r4, lr}
+       mov     r4, r0
+       bl      _C_LABEL(__errno)
+       str     r4, [r0]
+       mvn     r0, #0x00000000
+       mvn     r1, #0x00000000
+       ldmfd   sp!, {r4, pc}
+#else
 #ifdef PIC
        /* Setup the GOT */
        ldr     r3, got
@@ -47,19 +56,20 @@
        ldr     r1, [r3, r1]
 #else
        ldr     r1, Lerrno
-#endif
+#endif /* PIC */
        str     r0, [r1]
        mvn     r0, #0x00000000
        mvn     r1, #0x00000000
-       mov     r15, r14
+       mov     pc, lr
 
 #ifdef PIC
        .align  0
 got:
        .word   __GLOBAL_OFFSET_TABLE_ + (. - (L1+4))
-#endif
+#endif /* PIC */
 
        .globl  _errno
 
 Lerrno:
        .word   _errno
+#endif /* _REENTRANT */
diff -r 418571ca3991 -r 11240f474eed lib/libc/arch/arm32/sys/ptrace.S
--- a/lib/libc/arch/arm32/sys/ptrace.S  Mon Jan 24 20:36:06 2000 +0000
+++ b/lib/libc/arch/arm32/sys/ptrace.S  Mon Jan 24 21:57:39 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptrace.S,v 1.4 1997/10/06 00:07:15 mark Exp $ */
+/*     $NetBSD: ptrace.S,v 1.5 2000/01/24 21:57:40 kleink Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -38,6 +38,13 @@
 #include "SYS.h"
 
 ENTRY(ptrace)
+#ifdef _REENTRANT
+       stmfd   sp!, {r0, r1, lr}
+       bl      _C_LABEL(__errno)
+       mov     r1, #0x00000000
+       str     r1, [r0]
+       ldmfd   sp!, {r0, r1, lr}
+#else
        stmfd   sp!, {r0, r1}
 #ifdef PIC
        /* Setup the GOT */
@@ -48,20 +55,23 @@
        ldr     r1, [r0, r1]
 #else
        ldr     r1, Lerrno
-#endif
+#endif /* PIC */
        mov     r0, #0x00000000
        str     r0, [r1]
        ldmfd   sp!, {r0, r1}
+#endif /* _REENTRANT */
 
        swi     SYS_ptrace
        bcs     cerror
-       mov     r15, r14
+       mov     pc, lr
 
+#ifndef _REENTRANT
 #ifdef PIC
        .align  0
 got:
        .word   __GLOBAL_OFFSET_TABLE_ + (. - (L1+4))
-#endif
+#endif /* PIC */
 
 Lerrno:
        .word   _errno
+#endif /* !_REENTRANT */



Home | Main Index | Thread Index | Old Index