This makes Xen/PPC dump a backtrace when a BUG() is triggered.

Signed-off-by: Amos Waterland <[EMAIL PROTECTED]>

---

 config.h |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff -r 5418062d2da8 xen/include/asm-powerpc/powerpc64/config.h
--- a/xen/include/asm-powerpc/powerpc64/config.h
+++ b/xen/include/asm-powerpc/powerpc64/config.h
@@ -38,7 +38,15 @@
 
 #ifndef __ASSEMBLY__
 
-#define FORCE_CRASH() __asm__ __volatile__ ( "trap" )
+#define FORCE_CRASH()                                                     \
+do {                                                                      \
+    unsigned long sp, lr, pc, 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));    \
+    show_backtrace(sp, lr, pc);                                           \
+    __asm__ __volatile__ ( "trap" );                                      \
+} while ( 0 )
 
 #endif /* __ASSEMBLY__ */
 

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

Reply via email to