Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2007 11:02:30 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 118354 for review
Message-ID:  <200704181102.l3IB2UeO010485@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118354

Change 118354 by gonzo@gonzo_jeeves on 2007/04/18 11:02:28

	o Rollback latest change and add comment why this is
	    the right thing (tm).

Affected files ...

.. //depot/projects/mips2/src/lib/libc/mips/sys/sbrk.S#6 edit

Differences ...

==== //depot/projects/mips2/src/lib/libc/mips/sys/sbrk.S#6 (text+ko) ====

@@ -55,15 +55,29 @@
 	.cpload	t9
 	.set	reorder
 #endif
-	lw	v1, _C_LABEL(__curbrk)
+	addu	sp, sp, -4
+	sw	s0, 0(sp)		# Preserve s0 value in stack
+					# it should be the same on return
+					# We can't use v1 as temporary
+					# register since syscall uses it
+					# to return 64-bit values
+	lw	s0, _C_LABEL(__curbrk)
 	li	v0, SYS_break
-	addu	a0, a0, v1		# compute current break
+	addu	a0, a0, s0		# compute current break
+
 	syscall
+
 	bne	a3, zero, 1f
-	move	v0, v1			# return old val of curbrk from above
+	nop
+	move	v0, s0			# return old val of curbrk from above
+	lw	s0, 0(sp)
+	addu	sp, sp, 4
 	sw	a0, _C_LABEL(__curbrk)	# save current val of curbrk from above
 	j	ra
+
 1:
+	lw	s0, 0(sp)
+	addu	sp, sp, 4
 	la	t9, _C_LABEL(__cerror)
 	jr	t9
 END(__sys_sbrk)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704181102.l3IB2UeO010485>