WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] [PATCH] Print backtrace on BUG

Hi Amos,

+do { \ + unsigned long sp, lr, pc, tp; \

You can do without "tp":

+ asm("mr %0, 1" : "=r" (sp)); \ + asm("mflr %0" : "=r" (lr)); \ + asm("mflr %0; bl 1f; 1: mflr %1; mtlr %0" : "=r" (tp), "=r" (pc)); \

        asm("bl $+4 ; mflr %0; mtlr %1" : "=r"(pc) : "r"(lr));            \

+ show_backtrace(sp, lr, pc); \ + __asm__ __volatile__ ( "trap" ); \
+} while ( 0 )

...and the one "asm" where you put "volatile" on is the only one that
doesn't need it :-)  (and no __ is needed either).

Alternatively (and preferred), you can make a single statement out
of the first three asm statements.


Segher


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>