When using the SVR4 ABI, return pointer results in a0, too.

This commit is contained in:
kleink 1999-05-02 20:34:04 +00:00
parent 1bd013aa27
commit 4e0adc06d5
7 changed files with 41 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.S,v 1.13 1997/05/15 16:07:31 jtc Exp $ */
/* $NetBSD: bcopy.S,v 1.14 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
#if 0
RCSID("from: @(#)bcopy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: bcopy.S,v 1.13 1997/05/15 16:07:31 jtc Exp $")
RCSID("$NetBSD: bcopy.S,v 1.14 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -165,6 +165,9 @@ Lbcfbyte:
Lbcdone:
#if defined(MEMCOPY) || defined(MEMMOVE)
movl sp@(4),d0 | dest address
#if defined(__SVR4_ABI__)
moveal d0,a0
#endif
#endif
rts
@ -233,5 +236,8 @@ Lbcbbyte:
#if defined(MEMCOPY) || defined(MEMMOVE)
movl sp@(4),d0 | dest address
#if defined(__SVR4_ABI__)
moveal d0,a0
#endif
#endif
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: index.S,v 1.7 1997/01/04 03:26:21 jtc Exp $ */
/* $NetBSD: index.S,v 1.8 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)index.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: index.S,v 1.7 1997/01/04 03:26:21 jtc Exp $")
RCSID("$NetBSD: index.S,v 1.8 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -60,6 +60,9 @@ ixloop:
tstb a0@+ | null?
jne ixloop | no, keep going
moveq #0,d0 | not found, return null
#ifdef __SVR4_ABI__
moveal d0,a0
#endif
rts
ixfound:
movl a0,d0 | found, return pointer

View File

@ -1,4 +1,4 @@
/* $NetBSD: memset.S,v 1.10 1997/05/14 18:18:44 jtc Exp $ */
/* $NetBSD: memset.S,v 1.11 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
#if 0
RCSID("from: @(#)bzero.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: memset.S,v 1.10 1997/05/14 18:18:44 jtc Exp $")
RCSID("$NetBSD: memset.S,v 1.11 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -158,5 +158,8 @@ Lbzbyte:
dbf d1,Lbzbloop | till done
Lbzdone:
movl sp@(8),d0 | return destination
#ifdef __SVR4_ABI__
moveal d0,a0
#endif
movl sp@+,d2
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: rindex.S,v 1.7 1997/01/04 03:26:24 jtc Exp $ */
/* $NetBSD: rindex.S,v 1.8 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)rindex.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: rindex.S,v 1.7 1997/01/04 03:26:24 jtc Exp $")
RCSID("$NetBSD: rindex.S,v 1.8 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -52,15 +52,15 @@ ENTRY(strrchr)
#else
ENTRY(rindex)
#endif
movl sp@(4),a0 | string
movl sp@(4),a1 | string
movb sp@(11),d0 | char to look for
subl a1,a1 | clear rindex pointer
subl a0,a0 | clear rindex pointer
rixloop:
cmpb a0@,d0 | found our char?
cmpb a1@,d0 | found our char?
jne rixnope | no, check for null
movl a0,a1 | yes, remember location
movl a1,a0 | yes, remember location
rixnope:
tstb a0@+ | null?
tstb a1@+ | null?
jne rixloop | no, keep going
movl a1,d0 | return value
movl a0,d0 | return value
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcat.S,v 1.7 1997/01/04 03:26:24 jtc Exp $ */
/* $NetBSD: strcat.S,v 1.8 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strcat.S,v 1.7 1997/01/04 03:26:24 jtc Exp $")
RCSID("$NetBSD: strcat.S,v 1.8 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -58,4 +58,7 @@ Lslloop:
Lscloop:
movb a0@+,a1@+ | copy a byte
jne Lscloop | copied non-null, keep going
#ifdef __SVR4_ABI__
moveal d0,a0
#endif
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcpy.S,v 1.7 1997/01/04 03:26:26 jtc Exp $ */
/* $NetBSD: strcpy.S,v 1.8 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strcpy.S,v 1.7 1997/01/04 03:26:26 jtc Exp $")
RCSID("$NetBSD: strcpy.S,v 1.8 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -54,4 +54,7 @@ ENTRY(strcpy)
Lscloop:
movb a0@+,a1@+ | copy a byte
jne Lscloop | copied non-null, keep going
#ifdef __SVR4_ABI__
moveal d0,a0
#endif
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: strncpy.S,v 1.8 1997/05/13 19:27:26 jtc Exp $ */
/* $NetBSD: strncpy.S,v 1.9 1999/05/02 20:34:04 kleink Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -43,7 +43,7 @@
#if 0
RCSID("from: @(#)strncpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strncpy.S,v 1.8 1997/05/13 19:27:26 jtc Exp $")
RCSID("$NetBSD: strncpy.S,v 1.9 1999/05/02 20:34:04 kleink Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -59,6 +59,9 @@ Lscloop:
subql #1,d1 | adjust count
jne Lscloop | more room, keep going
Lscdone:
#ifdef __SVR4_ABI__
moveal d0,a0
#endif
rts
Lscploop:
subql #1,d1 | adjust count