Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 2015 02:40:41 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291463 - in head/sys/powerpc: include powerpc
Message-ID:  <201511300240.tAU2efnn029432@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Mon Nov 30 02:40:41 2015
New Revision: 291463
URL: https://svnweb.freebsd.org/changeset/base/291463

Log:
  Print machine check address for Book-E.
  
  Bits in mcsr indicate if the address is valid, and whether it's a physical
  address or effective address.
  
  Sponsored by:	Alex Perez/Inertial Computing

Modified:
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/include/spr.h
==============================================================================
--- head/sys/powerpc/include/spr.h	Mon Nov 30 02:23:56 2015	(r291462)
+++ head/sys/powerpc/include/spr.h	Mon Nov 30 02:40:41 2015	(r291463)
@@ -652,7 +652,9 @@
 
 #elif defined(BOOKE)
 
+#define	SPR_MCARU		0x239	/* ..8 Machine Check Address register upper bits */
 #define	SPR_MCSR		0x23c	/* ..8 Machine Check Syndrome register */
+#define	SPR_MCAR		0x23d	/* ..8 Machine Check Address register */
 
 #define	SPR_ESR			0x003e	/* ..8 Exception Syndrome Register */
 #define	  ESR_PIL		  0x08000000 /* Program interrupt - illegal */

Modified: head/sys/powerpc/powerpc/trap.c
==============================================================================
--- head/sys/powerpc/powerpc/trap.c	Mon Nov 30 02:23:56 2015	(r291462)
+++ head/sys/powerpc/powerpc/trap.c	Mon Nov 30 02:40:41 2015	(r291463)
@@ -401,6 +401,9 @@ static void
 printtrap(u_int vector, struct trapframe *frame, int isfatal, int user)
 {
 	uint16_t ver;
+#ifdef BOOKE
+	vm_paddr_t pa;
+#endif
 
 	printf("\n");
 	printf("%s %s trap:\n", isfatal ? "fatal" : "handled",
@@ -429,7 +432,10 @@ printtrap(u_int vector, struct trapframe
 			printf("    msssr0         = 0x%lx\n",
 			    (u_long)mfspr(SPR_MSSSR0));
 #elif defined(BOOKE)
-		printf("   mcsr           = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
+		pa = mfspr(SPR_MCARU);
+		pa = (pa << 32) | mfspr(SPR_MCAR);
+		printf("   mcsr            = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
+		printf("   mcar            = 0x%jx\n", (uintmax_t)pa);
 #endif
 		break;
 	}



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