Module Name:    src
Committed By:   matt
Date:           Sun Apr 14 15:53:30 UTC 2013

Modified Files:
        src/common/lib/libc/arch/arm/quad: __aeabi_ldivmod.S __aeabi_uldivmod.S

Log Message:
Fix calling of __qdivrem which the 3rd arg needs to passed on the stack.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S
diff -u src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S:1.1 src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S:1.2
--- src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S:1.1	Sun Aug  5 06:33:51 2012
+++ src/common/lib/libc/arch/arm/quad/__aeabi_ldivmod.S	Sun Apr 14 15:53:30 2013
@@ -29,7 +29,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: __aeabi_ldivmod.S,v 1.1 2012/08/05 06:33:51 matt Exp $")
+RCSID("$NetBSD: __aeabi_ldivmod.S,v 1.2 2013/04/14 15:53:30 matt Exp $")
 
 ENTRY(__aeabi_ldivmod)
 	push	{r4-r5, sl, lr}
@@ -64,9 +64,11 @@ ENTRY(__aeabi_ldivmod)
 	 * Arguments are setup, allocate some stack for the remainder
 	 * and call __qdivrem for the heavy lifting.
 	 */
-	sub	sp, sp, #8
-	mov	r4, sp		/* pointer to remainder */
+	sub	sp, sp, #16
+	add	ip, sp, #8
+	str	ip, [sp]
 	bl	PLT_SYM(__qdivrem)
+	add	sp, sp, #8
 
 	teq	NEG, #0		/* any signs to flip? */
 	/*
@@ -124,5 +126,4 @@ ENTRY(__aeabi_ldivmod)
 	mov	AHI, #0
 	pop	{r4-r5, sl, lr}
 	RET
-
 END(__aeabi_ldivmod)

Index: src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S
diff -u src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S:1.2 src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S:1.3
--- src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S:1.2	Sun Aug  5 06:34:09 2012
+++ src/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S	Sun Apr 14 15:53:30 2013
@@ -29,7 +29,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: __aeabi_uldivmod.S,v 1.2 2012/08/05 06:34:09 matt Exp $")
+RCSID("$NetBSD: __aeabi_uldivmod.S,v 1.3 2013/04/14 15:53:30 matt Exp $")
 
 /*
  * typedef struct { unsigned long long quo, rem } ulldiv_t;
@@ -39,9 +39,11 @@ RCSID("$NetBSD: __aeabi_uldivmod.S,v 1.2
 
 ENTRY(__aeabi_uldivmod)
 	push	{r4,lr}
-	sub	sp, sp, #8
-	mov	r4, sp
-	bl	PLT_SYM(__qdivrem)
+	sub	sp, sp, #16
+	add	ip, sp, #8
+	str	ip, [sp]
+	blx	PLT_SYM(__qdivrem)
+	add	sp, sp, #8
 	/*
 	 * The remainder is already on the stack just waiting to be popped
 	 * into r2/r3.

Reply via email to