Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/i386/stdlib Functions that return a struct or ...



details:   https://anonhg.NetBSD.org/src/rev/42fabb3cc36e
branches:  trunk
changeset: 766001:42fabb3cc36e
user:      plunky <plunky%NetBSD.org@localhost>
date:      Sun Jun 12 20:29:25 2011 +0000

description:
Functions that return a struct or union, must set %eax to the value
of the original address of the callers area before it returns.

(System V ABI, i386 supplement, fourth edition, page 3-14)

diffstat:

 lib/libc/arch/i386/stdlib/div.S  |  5 +++--
 lib/libc/arch/i386/stdlib/ldiv.S |  5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (50 lines):

diff -r 102be4a45c98 -r 42fabb3cc36e lib/libc/arch/i386/stdlib/div.S
--- a/lib/libc/arch/i386/stdlib/div.S   Sun Jun 12 20:23:29 2011 +0000
+++ b/lib/libc/arch/i386/stdlib/div.S   Sun Jun 12 20:29:25 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: div.S,v 1.8 2003/07/26 19:24:33 salo Exp $     */
+/*     $NetBSD: div.S,v 1.9 2011/06/12 20:29:25 plunky Exp $   */
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
  * Public domain.
@@ -7,7 +7,7 @@
 #include <machine/asm.h>
 
 #if defined(LIBC_SCCS)
-RCSID("$NetBSD: div.S,v 1.8 2003/07/26 19:24:33 salo Exp $")
+RCSID("$NetBSD: div.S,v 1.9 2011/06/12 20:29:25 plunky Exp $")
 #endif
 
 ENTRY(div)
@@ -19,5 +19,6 @@
        idiv    %ecx
        movl    %eax,(%ebx)
        movl    %edx,4(%ebx)
+       movl    %ebx,%eax
        popl    %ebx
        ret     $4
diff -r 102be4a45c98 -r 42fabb3cc36e lib/libc/arch/i386/stdlib/ldiv.S
--- a/lib/libc/arch/i386/stdlib/ldiv.S  Sun Jun 12 20:23:29 2011 +0000
+++ b/lib/libc/arch/i386/stdlib/ldiv.S  Sun Jun 12 20:29:25 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldiv.S,v 1.8 2003/07/26 19:24:33 salo Exp $    */
+/*     $NetBSD: ldiv.S,v 1.9 2011/06/12 20:29:25 plunky Exp $  */
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
  * Public domain.
@@ -7,7 +7,7 @@
 #include <machine/asm.h>
 
 #if defined(LIBC_SCCS)
-RCSID("$NetBSD: ldiv.S,v 1.8 2003/07/26 19:24:33 salo Exp $")
+RCSID("$NetBSD: ldiv.S,v 1.9 2011/06/12 20:29:25 plunky Exp $")
 #endif
 
 ENTRY(ldiv)
@@ -19,5 +19,6 @@
        idiv    %ecx
        movl    %eax,(%ebx)
        movl    %edx,4(%ebx)
+       movl    %ebx,%eax
        popl    %ebx
        ret     $4



Home | Main Index | Thread Index | Old Index