From 2dbc3fb187fc7e7afba54356603c4686dd883d33 Mon Sep 17 00:00:00 2001 From: jhibbits Date: Sun, 8 Apr 2018 16:55:28 +0000 Subject: [PATCH] powerpc64: Print current MSR on printtrap() Summary: Print current MSR on printtrap(). Currently, printtrap just prints srr1, which contains part of the MSR prior to the exception. I find useful to dump the current value of the MSR, since it changes when there is an interruption. With this patch, this is the new printtrap model: handled user trap: exception = 0x700 (program) srr0 = 0x100008a0 (0x100008a0) srr1 = 0x800000000002f032 current msr = 0x8000000000009032 lr = 0x1000089c (0x1000089c) curthread = 0x7a50000 pid = 714, comm = ttrap2 Submitted by: Breno Leitao Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D14600 --- sys/powerpc/powerpc/trap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 609dd0090ade..7ed11907e838 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -507,6 +507,7 @@ printtrap(u_int vector, struct trapframe *frame, int isfatal, int user) printf(" srr0 = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n", frame->srr0, frame->srr0 - (register_t)(__startkernel - KERNBASE)); printf(" srr1 = 0x%lx\n", (u_long)frame->srr1); + printf(" current msr = 0x%" PRIxPTR "\n", mfmsr()); printf(" lr = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n", frame->lr, frame->lr - (register_t)(__startkernel - KERNBASE)); printf(" curthread = %p\n", curthread);