[PATCH] ppc64 kdb to print SDR1 along with other SPRs

Anil K Prasad aprasad at in.ibm.com
Sun Dec 7 11:58:06 EST 2003


Hi,
I am not sure why there is no option to see SDR1 value in kdb. I had
expected it to be under 'superreg' option.
Anyway, I have just added extra printf for SDR1.. and below is patch for
the same.

Thanks,
Anil.

--------------------------------------------------------------------------PATCH

BEGIN---------------------------------------------------------------------------------
--- linux-2.4.21/arch/ppc64/kdb/kdbasupport.c   2003-12-06
16:30:53.000000000 -0800
+++ linux-myfix/arch/ppc64/kdb/kdbasupport.c    2003-12-06
15:13:10.000000000 -0800
@@ -1661,6 +1661,7 @@
            kdb_printf("toc  = %.16lx  dar  = %.16lx\n", toc, get_dar());
            kdb_printf("srr0 = %.16lx  srr1 = %.16lx\n", get_srr0(),
get_srr1());
            kdb_printf("asr  = %.16lx\n", mfasr());
+           kdb_printf("sdr1 = %.16lx\n", mfsdr1());
            for (i = 0; i < 8; ++i)
                  kdb_printf("sr%.2ld = %.16lx  sr%.2ld = %.16lx\n", (long
int)i, (unsigned long)get_sr(i), (long int)(i+8), (long unsigned int)
get_sr(i+8));

--- linux-2.4.21/include/asm-ppc64/processor.h  2003-12-06
16:29:13.000000000 -0800
+++ linux-myfix/include/asm-ppc64/processor.h   2003-12-06
16:28:56.000000000 -0800
@@ -594,6 +594,8 @@

 #define mfasr()        ({unsigned long rval; \
                  asm volatile("mfasr %0" : "=r" (rval)); rval;})
+#define mfsdr1()             ({unsigned long rval; \
+                 asm volatile("mfsdr1 %0" : "=r" (rval)); rval;})

 #ifndef __ASSEMBLY__
 extern int have_of;


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list