Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc Use SYSTRAP.
details: https://anonhg.NetBSD.org/src/rev/6c297b5b3c00
branches: trunk
changeset: 787969:6c297b5b3c00
user: matt <matt%NetBSD.org@localhost>
date: Tue Jul 16 23:00:15 2013 +0000
description:
Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
diffstat:
lib/libc/arch/m68k/sys/__clone.S | 5 +-
lib/libc/arch/m68k/sys/__vfork14.S | 12 ++--
lib/libc/arch/m68k/sys/brk.S | 31 ++++++-------
lib/libc/arch/m68k/sys/cerror.S | 7 +-
lib/libc/arch/m68k/sys/ptrace.S | 14 ++---
lib/libc/arch/m68k/sys/sbrk.S | 25 +++--------
lib/libc/compat/arch/m68k/sys/compat_Ovfork.S | 43 ++++++-------------
lib/libc/compat/arch/m68k/sys/compat___sigreturn14.S | 26 ++++-------
lib/libc/compat/arch/m68k/sys/compat___sigtramp1.S | 9 ++-
lib/libc/compat/arch/m68k/sys/compat_sigpending.S | 9 ++-
lib/libc/compat/arch/m68k/sys/compat_sigprocmask.S | 28 ++++++------
lib/libc/compat/arch/m68k/sys/compat_sigreturn.S | 24 ++++------
lib/libc/compat/arch/m68k/sys/compat_sigsuspend.S | 16 +++----
13 files changed, 105 insertions(+), 144 deletions(-)
diffs (truncated from 571 to 300 lines):
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/__clone.S
--- a/lib/libc/arch/m68k/sys/__clone.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/__clone.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.4 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: __clone.S,v 1.5 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -62,4 +62,5 @@
/* NOTREACHED */
1: rts
2: movl #EINVAL,%d0
-3: jra PIC_PLT(CERROR)
+3: jbra CERROR
+END(__clone)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/__vfork14.S
--- a/lib/libc/arch/m68k/sys/__vfork14.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/__vfork14.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: __vfork14.S,v 1.10 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: __vfork14.S,v 1.11 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: __vfork14.S,v 1.10 2013/07/16 20:49:42 matt Exp $")
+ RCSID("$NetBSD: __vfork14.S,v 1.11 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -61,8 +61,7 @@
ENTRY(__vfork14)
movl (%sp)+,%a1
- movl #SYS___vfork14,%d0
- trap #0
+ SYSTRAP(__vfork14)
jcs err
subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */
andl %d1,%d0
@@ -81,14 +80,15 @@
#endif
movl (%sp)+,%a1
#else
- .globl _C_LABEL(errno)
#ifdef PIC
- lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),%a0
+ GOT_SETUP(%a0)
movl _C_LABEL(errno)@GOT:w(%a0),%a0
movl %d0,(%a0)
#else
+ .globl _C_LABEL(errno)
movl %d0,_C_LABEL(errno)
#endif /* PIC */
#endif /* _REENTRANT */
moveq #-1,%d0
jmp (%a1)
+END(__vfork14)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/brk.S
--- a/lib/libc/arch/m68k/sys/brk.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/brk.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brk.S,v 1.16 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: brk.S,v 1.17 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,15 @@
#if 0
RCSID("from: @(#)brk.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: brk.S,v 1.16 2013/07/16 20:49:42 matt Exp $")
+ RCSID("$NetBSD: brk.S,v 1.17 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
.globl _end
.globl _C_LABEL(__minbrk)
+ .hidden _C_LABEL(__minbrk)
.globl _C_LABEL(__curbrk)
+ .hidden _C_LABEL(__curbrk)
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
@@ -59,26 +61,23 @@
ENTRY(_brk)
#ifdef PIC
- lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),%a1
- movl _C_LABEL(__minbrk)@GOT:w(%a1),%a0
- movl (%a0),%d0
+ LEA_LCL(_C_LABEL(__minbrk),%a1)
+ movl (%a1),%a1
#else
- movl _C_LABEL(__minbrk),%d0
+ movl _C_LABEL(__minbrk),%a1
#endif
- cmpl 4(%sp),%d0
+ cmpl 4(%sp),%a1
jls ok
- movl %d0,4(%sp)
+ movl %a1,4(%sp)
ok:
- movl #SYS_break,%d0
- trap #0
- jcs err
+ SYSTRAP(break)
+ jcc CERROR
#ifdef PIC
- movl _C_LABEL(__curbrk)@GOT:w(%a1),%a0
- movl 4(%sp),(%a0)
+ LEA_LCL(_C_LABEL(__curbrk),%a0)
+ movl %a1,(%a0)
#else
- movl 4(%sp),_C_LABEL(__curbrk)
+ movl %a1,_C_LABEL(__curbrk)
#endif
clrl %d0
rts
-err:
- jra PIC_PLT(CERROR)
+END(_brk)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/cerror.S
--- a/lib/libc/arch/m68k/sys/cerror.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/cerror.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cerror.S,v 1.16 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: cerror.S,v 1.17 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)cerror.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: cerror.S,v 1.16 2013/07/16 20:49:42 matt Exp $")
+ RCSID("$NetBSD: cerror.S,v 1.17 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -58,7 +58,7 @@
movl (%sp)+,(%a0)
#else
#ifdef PIC
- lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),%a0
+ GOT_SETUP(%a0)
movl _C_LABEL(errno)@GOT:w(%a0),%a0
movl %d0,(%a0)
#else
@@ -71,3 +71,4 @@
movl %d0,%a0
#endif
rts
+END(CERROR)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/ptrace.S
--- a/lib/libc/arch/m68k/sys/ptrace.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/ptrace.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.S,v 1.12 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: ptrace.S,v 1.13 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: ptrace.S,v 1.12 2013/07/16 20:49:42 matt Exp $")
+ RCSID("$NetBSD: ptrace.S,v 1.13 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -58,16 +58,14 @@
clrl (%a0)
#else
#ifdef PIC
- lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),%a0
+ GOT_SETUP(%a0)
movl _C_LABEL(errno)@GOT:w(%a0),%a0
clrl (%a0)
#else
clrl _C_LABEL(errno)
#endif /* PIC */
#endif /* _REENTRANT */
- movl #SYS_ptrace,%d0
- trap #0
- jcs err
+ SYSTRAP(ptrace)
+ jcc CERROR
rts
-err:
- jra PIC_PLT(CERROR)
+END(ptrace)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/arch/m68k/sys/sbrk.S
--- a/lib/libc/arch/m68k/sys/sbrk.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/arch/m68k/sys/sbrk.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbrk.S,v 1.15 2013/07/16 20:49:42 matt Exp $ */
+/* $NetBSD: sbrk.S,v 1.16 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,12 +39,13 @@
#if 0
RCSID("from: @(#)sbrk.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: sbrk.S,v 1.15 2013/07/16 20:49:42 matt Exp $")
+ RCSID("$NetBSD: sbrk.S,v 1.16 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
.globl _end
.globl _C_LABEL(__curbrk)
+ .hidden _C_LABEL(__curbrk)
#ifdef WEAK_ALIAS
WEAK_ALIAS(sbrk, _sbrk)
@@ -57,27 +58,15 @@
.text
ENTRY(_sbrk)
-#ifdef PIC
- lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),%a1
- movl _C_LABEL(__curbrk)@GOT:w(%a1),%a1
+ LEA_LCL(_C_LABEL(__curbrk),%a1)
movl (%a1),%d0
-#else
- movl _C_LABEL(__curbrk),%d0
-#endif
addl %d0,4(%sp)
- movl #SYS_break,%d0
- trap #0
- jcs err
-#ifdef PIC
+ SYSTRAP(break)
+ jcc CERROR
movl (%a1),%d0
movl 4(%sp),(%a1)
-#else
- movl _C_LABEL(__curbrk),%d0
- movl 4(%sp),_C_LABEL(__curbrk)
-#endif
#ifdef __SVR4_ABI__
movl %d0,%a0
#endif
rts
-err:
- jra PIC_PLT(CERROR)
+END(_sbrk)
diff -r ac44b337370b -r 6c297b5b3c00 lib/libc/compat/arch/m68k/sys/compat_Ovfork.S
--- a/lib/libc/compat/arch/m68k/sys/compat_Ovfork.S Tue Jul 16 22:23:15 2013 +0000
+++ b/lib/libc/compat/arch/m68k/sys/compat_Ovfork.S Tue Jul 16 23:00:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_Ovfork.S,v 1.1 2006/03/09 16:20:55 christos Exp $ */
+/* $NetBSD: compat_Ovfork.S,v 1.2 2013/07/16 23:00:15 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: compat_Ovfork.S,v 1.1 2006/03/09 16:20:55 christos Exp $")
+ RCSID("$NetBSD: compat_Ovfork.S,v 1.2 2013/07/16 23:00:15 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -63,48 +63,35 @@
*/
ENTRY(vfork)
- movl %sp@+,%a1
- movl #SYS_vfork,%d0
- trap #0
+ movl (%sp)+,%a1
+ SYSTRAP(vfork)
jcs err
subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */
andl %d1,%d0
- jmp %a1@
+ jmp (%a1)
err:
#ifdef _REENTRANT
.globl _C_LABEL(__errno)
- movl %a1,%sp@-
- movl %d0,%sp@-
-#if defined(PIC) && !defined(__ELF__)
- movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a1
- lea %pc@(0,a1:l),%a1
- movl %a1@(_C_LABEL(__errno):l),%a1
- jsr %a1@
-#else
+ movl %a1,-(%sp)
+ movl %d0,-(%sp)
jbsr PIC_PLT(_C_LABEL(__errno))
-#endif /* PIC */
Home |
Main Index |
Thread Index |
Old Index