svn commit: r298560 - head/sys/powerpc/powerpc
Justin Hibbits
jhibbits at FreeBSD.org
Mon Apr 25 03:01:58 UTC 2016
Author: jhibbits
Date: Mon Apr 25 03:01:57 2016
New Revision: 298560
URL: https://svnweb.freebsd.org/changeset/base/298560
Log:
OR in the unsigned form of the MCAR lower register.
When ORing in a register_t to a wider integer (vm_paddr_t), it gets sign
extended, so high addresses overwrite the upper word with all 0xf. Cast to the
unsigned form (u_register_t), to avoid this problem, and get correct addresses
printed.
Modified:
head/sys/powerpc/powerpc/trap.c
Modified: head/sys/powerpc/powerpc/trap.c
==============================================================================
--- head/sys/powerpc/powerpc/trap.c Mon Apr 25 00:55:51 2016 (r298559)
+++ head/sys/powerpc/powerpc/trap.c Mon Apr 25 03:01:57 2016 (r298560)
@@ -434,7 +434,7 @@ printtrap(u_int vector, struct trapframe
(u_long)mfspr(SPR_MSSSR0));
#elif defined(BOOKE)
pa = mfspr(SPR_MCARU);
- pa = (pa << 32) | mfspr(SPR_MCAR);
+ pa = (pa << 32) | (u_register_t)mfspr(SPR_MCAR);
printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
printf(" mcar = 0x%jx\n", (uintmax_t)pa);
#endif
More information about the svn-src-head
mailing list