Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 2010 13:08:35 +0200
From:      =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= <phcoder@gmail.com>
To:        freebsd-mips@freebsd.org
Subject:   Re: [PATCH] [yeeloong] Create frame in blkclr
Message-ID:  <4CA07B33.7070803@gmail.com>
In-Reply-To: <4CA04686.2080101@gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On 09/27/2010 09:23 AM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> It happens often that one tries to bzero an incorrect range which, of
> course, triggers a kernel panic but unfortunately backtrace doesn't work
> properly because bzero doesn't create a stack frame. Attached patch fixes it
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2 --]
=== modified file 'mips/mips/support.S'
--- mips/mips/support.S	2010-08-13 22:16:49 +0000
+++ mips/mips/support.S	2010-08-13 22:20:49 +0000
@@ -97,6 +97,8 @@
 
 #include "assym.s"
 
+#define MAKE_FRAMES 1
+
 	.set	noreorder		# Noreorder is default style!
 
 /*
@@ -827,6 +829,12 @@
 LEAF(bzero)
 ALEAF(blkclr)
 	.set	noreorder
+#ifdef MAKE_FRAMES
+	daddiu   sp, sp, -32
+	sd      ra, 16(sp)
+	sd      a0, 8(sp)
+	sd      a1, 0(sp)
+#endif
 	blt	a1, 12, smallclr	# small amount to clear?
 	PTR_SUBU	a3, zero, a0		# compute # bytes to word align address
 	and	a3, a3, 3
@@ -851,11 +859,13 @@
 	bne	a0, a3, 1b
 	sb	zero, -1(a0)
 2:
+#ifdef MAKE_FRAMES
+	daddiu  sp, sp, 32
+#endif
 	j	ra
 	nop
 END(bzero)
 
-
 /*
  * bcmp(s1, s2, n)
  */

home | help

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