|
|
|
|
|
|
|
|
|
|
xen-ppc-devel
[XenPPC] [PATCH] Print backtrace on BUG
This makes Xen/PPC dump a backtrace when a BUG() is triggered.
Signed-off-by: Amos Waterland <apw@xxxxxxxxxx>
---
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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [XenPPC] [PATCH] Print backtrace on BUG,
Amos Waterland <=
|
|
|
|
|