Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/m68k/sys SystemV-R4 ABI for M68k returns point...



details:   https://anonhg.NetBSD.org/src/rev/2896fe1477e2
branches:  trunk
changeset: 747867:2896fe1477e2
user:      phx <phx%NetBSD.org@localhost>
date:      Sat Oct 03 22:28:33 2009 +0000

description:
SystemV-R4 ABI for M68k returns pointers in %a0, so we have to make sure
that CERROR returns -1 in %a0 in addition to %d0 and %d1, to make functions
like mmap(2), mremap(2), shmat(2) or sbrk(2) return -1 in case of an error.
A side effect of this bug was a segfault caused by jemalloc, when mmap()
failed.

diffstat:

 lib/libc/arch/m68k/sys/cerror.S |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r c5f187809993 -r 2896fe1477e2 lib/libc/arch/m68k/sys/cerror.S
--- a/lib/libc/arch/m68k/sys/cerror.S   Sat Oct 03 21:21:56 2009 +0000
+++ b/lib/libc/arch/m68k/sys/cerror.S   Sat Oct 03 22:28:33 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cerror.S,v 1.14 2003/08/07 16:42:14 agc Exp $  */
+/*     $NetBSD: cerror.S,v 1.15 2009/10/03 22:28:33 phx 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.14 2003/08/07 16:42:14 agc Exp $")
+       RCSID("$NetBSD: cerror.S,v 1.15 2009/10/03 22:28:33 phx Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -80,4 +80,7 @@
 #endif /* _REENTRANT */
        movl    #-1,%d0
        movl    #-1,%d1
+#ifdef __SVR4_ABI__
+       movl    %d0,%a0
+#endif
        rts



Home | Main Index | Thread Index | Old Index