From e6cff0f7c1fdd2477ed9984e37db89ae6c77a461 Mon Sep 17 00:00:00 2001 From: jhibbits Date: Mon, 25 Apr 2016 03:01:57 +0000 Subject: [PATCH] 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. --- sys/powerpc/powerpc/trap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 62d91a677973..d1860513fe45 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -434,7 +434,7 @@ printtrap(u_int vector, struct trapframe *frame, int isfatal, int user) (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