From 4e0adc06d5006089e1d2dfb27afc6a29adc5950a Mon Sep 17 00:00:00 2001 From: kleink Date: Sun, 2 May 1999 20:34:04 +0000 Subject: [PATCH] When using the SVR4 ABI, return pointer results in a0, too. --- lib/libc/arch/m68k/string/bcopy.S | 10 ++++++++-- lib/libc/arch/m68k/string/index.S | 7 +++++-- lib/libc/arch/m68k/string/memset.S | 7 +++++-- lib/libc/arch/m68k/string/rindex.S | 16 ++++++++-------- lib/libc/arch/m68k/string/strcat.S | 7 +++++-- lib/libc/arch/m68k/string/strcpy.S | 7 +++++-- lib/libc/arch/m68k/string/strncpy.S | 7 +++++-- 7 files changed, 41 insertions(+), 20 deletions(-) diff --git a/lib/libc/arch/m68k/string/bcopy.S b/lib/libc/arch/m68k/string/bcopy.S index 8aa4f6e895e6..5155a493801b 100644 --- a/lib/libc/arch/m68k/string/bcopy.S +++ b/lib/libc/arch/m68k/string/bcopy.S @@ -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 diff --git a/lib/libc/arch/m68k/string/index.S b/lib/libc/arch/m68k/string/index.S index 090c1b255d92..ffd35590b46c 100644 --- a/lib/libc/arch/m68k/string/index.S +++ b/lib/libc/arch/m68k/string/index.S @@ -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 diff --git a/lib/libc/arch/m68k/string/memset.S b/lib/libc/arch/m68k/string/memset.S index f8d6d8534bfd..5095a2753c3d 100644 --- a/lib/libc/arch/m68k/string/memset.S +++ b/lib/libc/arch/m68k/string/memset.S @@ -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 diff --git a/lib/libc/arch/m68k/string/rindex.S b/lib/libc/arch/m68k/string/rindex.S index f3f219c3cbda..5d3777946312 100644 --- a/lib/libc/arch/m68k/string/rindex.S +++ b/lib/libc/arch/m68k/string/rindex.S @@ -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 diff --git a/lib/libc/arch/m68k/string/strcat.S b/lib/libc/arch/m68k/string/strcat.S index c4ca140947a4..88dba8c8be15 100644 --- a/lib/libc/arch/m68k/string/strcat.S +++ b/lib/libc/arch/m68k/string/strcat.S @@ -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 diff --git a/lib/libc/arch/m68k/string/strcpy.S b/lib/libc/arch/m68k/string/strcpy.S index 526cc36addb1..a5d4217778ba 100644 --- a/lib/libc/arch/m68k/string/strcpy.S +++ b/lib/libc/arch/m68k/string/strcpy.S @@ -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 diff --git a/lib/libc/arch/m68k/string/strncpy.S b/lib/libc/arch/m68k/string/strncpy.S index 97ca04158f05..4781946a957d 100644 --- a/lib/libc/arch/m68k/string/strncpy.S +++ b/lib/libc/arch/m68k/string/strncpy.S @@ -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