[PATCH] [yeeloong] Create frame in blkclr

Vladimir 'φ-coder/phcoder' Serbinenko phcoder at gmail.com
Mon Sep 27 11:09:10 UTC 2010


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

-------------- next part --------------
=== 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)
  */


More information about the freebsd-mips mailing list