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

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Add a WARN() facility

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC][XEN] Add a WARN() facility
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Aug 2006 13:10:33 +0000
Delivery-date: Thu, 31 Aug 2006 06:13:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 168867efb453d54f5decc73435965254e423bc68
# Parent  2bf7c6cb46e32eed10ffbe573381aa23400f84ea
[POWERPC][XEN] Add a WARN() facility

So easy and so useful, I could not resist.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/backtrace.c        |   17 +++++++++++++++++
 xen/arch/powerpc/usercopy.c         |    1 +
 xen/include/asm-powerpc/processor.h |    4 ++++
 3 files changed, 22 insertions(+)

diff -r 2bf7c6cb46e3 -r 168867efb453 xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c      Thu Aug 31 08:32:55 2006 -0400
+++ b/xen/arch/powerpc/backtrace.c      Thu Aug 31 09:10:36 2006 -0400
@@ -191,3 +191,20 @@ void show_backtrace(ulong sp, ulong lr, 
     backtrace(sp, lr, pc);
     console_end_sync();
 }
+
+void __warn(char *file, int line)
+{
+    ulong sp;
+    ulong lr;
+
+    console_start_sync();
+    printk("WARN at %s:%d\n", file, line);
+
+    sp = (ulong)__builtin_frame_address(0);
+    lr = (ulong)__builtin_return_address(0);
+
+    backtrace(sp, lr, lr);
+    console_end_sync();
+}
+
+    
diff -r 2bf7c6cb46e3 -r 168867efb453 xen/arch/powerpc/usercopy.c
--- a/xen/arch/powerpc/usercopy.c       Thu Aug 31 08:32:55 2006 -0400
+++ b/xen/arch/powerpc/usercopy.c       Thu Aug 31 09:10:36 2006 -0400
@@ -59,6 +59,7 @@ static unsigned long paddr_to_maddr(unsi
     case PFN_TYPE_REMOTE:
         printk("%s: Dom:%d paddr: 0x%lx type: REMOTE\n",
                __func__, d->domain_id, paddr);
+        WARN();
         break;
     default:
         panic("%s: Dom:%d paddr: 0x%lx bad type:0x%x\n",
diff -r 2bf7c6cb46e3 -r 168867efb453 xen/include/asm-powerpc/processor.h
--- a/xen/include/asm-powerpc/processor.h       Thu Aug 31 08:32:55 2006 -0400
+++ b/xen/include/asm-powerpc/processor.h       Thu Aug 31 09:10:36 2006 -0400
@@ -52,6 +52,10 @@ extern void load_cpu_sprs(struct vcpu *)
 /* XXX this could also land us in GDB */
 #define dump_execution_state() BUG()
 
+extern void __warn(char *file, int line);
+#define WARN() __warn(__FILE__, __LINE__)
+#define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
+
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(const void *x) {;}
 

_______________________________________________
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] [xenppc-unstable] [POWERPC][XEN] Add a WARN() facility, Xen patchbot-xenppc-unstable <=