PERFORCE change 102985 for review

John Birrell jb at FreeBSD.org
Wed Aug 2 02:32:01 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=102985

Change 102985 by jb at jb_freebsd2 on 2006/08/02 02:31:16

	Add some debugging statements to set aside the %pc and %tick in the
	per-cpu structure.

Affected files ...

.. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/interrupt.S#2 edit

Differences ...

==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/interrupt.S#2 (text+ko) ====

@@ -29,6 +29,7 @@
 __FBSDID("$FreeBSD: src/sys/sparc64/sparc64/interrupt.S,v 1.8 2005/04/16 15:05:56 marius Exp $");
 
 #include "opt_simulator.h"
+#include "opt_trap_trace.h"
 #include <machine/hypervisorvar.h>
 #include <machine/asi.h>
 #include <machine/asmacros.h>
@@ -437,6 +438,25 @@
 	membar	#Sync
 	GET_PCPU_PHYS_SCRATCH(%g6)
 	wr	%g0, ASI_REAL, %asi
+
+#ifdef TRAP_TRACING
+	/* pcpu->pad[0] = %pc */
+	rd	%pc, %g4
+	stxa	%g4, [PCPU(PAD)]%asi
+
+	/* pcpu->pad[1] = %tick */
+	rdpr	%tick, %g4
+	stxa    %g4, [PCPU(PAD) + 8]%asi
+
+	/*
+	 * Increment a counter which might help us notice if we're
+	 * stuck in a loop. pcpu->pad[2] = count
+	 */
+	ldxa	[PCPU(PAD) + 16]%asi, %g4
+	add	%g4, 1, %g4
+	stxa    %g4, [PCPU(PAD) + 16]%asi
+#endif
+
 	lda	[PCPU(CPUMASK)]%asi, %g4
 	lda	[%g3]%asi, %g1
 1:	or	%g1, %g4, %g2


More information about the p4-projects mailing list