Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2003 20:10:35 -0700 (PDT)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 32147 for review
Message-ID:  <200305310310.h4V3AZSZ097119@repoman.freebsd.org>

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

Change 32147 by jmallett@jmallett_dalek on 2003/05/30 20:10:08

	Set up the auxillary frame for DDB.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/exception.S#3 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/exception.S#3 (text+ko) ====

@@ -9,6 +9,8 @@
  * $FreeBSD$
  */
 
+#include "opt_ddb.h"
+
 #include <machine/asm.h>
 #include <machine/cpuregs.h>
 
@@ -41,7 +43,18 @@
 	j	exception_save_registers
 	move	k1, sp
 1:
+
 	/*
+	 * A generic exception may result in DDB being invoked.  If we
+	 * are using the kernel debugger, then set up is auxillary
+	 * frame, so it has a full one.
+	 */
+#if	DDB
+	jal	save_kdbaux
+	nop
+#endif /* DDB */
+
+	/*
 	 * Call trap() with arguments:
 	 * trapframe, cause, badvaddr.
 	 *
@@ -214,3 +227,31 @@
 	jr	k0
 	nop
 END(exception_save_registers)
+
+#if	DDB
+/*
+ * Save the kdbaux structure for DDB.
+ */
+ENTRY(save_kdbaux)
+	/*
+	 * If we are using the kernel debugger, store registers that
+	 * the compiler normally saves in the place where it expects
+	 * to find them, to form a full frame.
+	 */
+	dla	k0, kdbaux
+	sd	s0, 0x00(k0)
+	sd	s1, 0x08(k0)
+	sd	s2, 0x10(k0)
+	sd	s3, 0x18(k0)
+	sd	s4, 0x20(k0)
+	sd	s5, 0x28(k0)
+	sd	s6, 0x30(k0)
+	sd	s7, 0x38(k0)
+	sd	sp, 0x40(k0)
+	sd	s8, 0x48(k0)
+	sd	gp, 0x50(k0)
+
+	jr	ra
+	nop
+END(save_kdbaux)
+#endif /* DDB */



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