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-devel

[Xen-devel] [PATCH] add generic WARN_ON()

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] add generic WARN_ON()
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 22 Mar 2007 14:19:43 +0000
Delivery-date: Thu, 22 Mar 2007 07:18:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The PowerPC and IA64 parts haven't been tested, I hope I didn't break
anything there.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2007-03-19/xen/include/asm-ia64/linux-xen/asm/iosapic.h
===================================================================
--- 2007-03-19.orig/xen/include/asm-ia64/linux-xen/asm/iosapic.h        
2006-07-17 08:27:48.000000000 +0200
+++ 2007-03-19/xen/include/asm-ia64/linux-xen/asm/iosapic.h     2007-03-19 
13:17:55.000000000 +0100
@@ -123,11 +123,10 @@ static inline void list_move(struct list
 
 #define move_irq(x)
 
-#define WARN_ON(condition) do { \
-       if (unlikely((condition)!=0)) { \
-               printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, 
__LINE__); \
-               dump_stack(); \
-       } \
+#undef WARN
+#define WARN() do { \
+       printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
+       dump_stack(); \
 } while (0)
 
 #ifdef nop
Index: 2007-03-19/xen/include/asm-powerpc/debugger.h
===================================================================
--- 2007-03-19.orig/xen/include/asm-powerpc/debugger.h  2006-12-15 
08:53:49.000000000 +0100
+++ 2007-03-19/xen/include/asm-powerpc/debugger.h       2007-03-19 
13:17:55.000000000 +0100
@@ -68,8 +68,8 @@ static inline void unimplemented(void)
 }
 
 extern void __warn(char *file, int line);
+#undef WARN
 #define WARN() __warn(__FILE__, __LINE__)
-#define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
 
 extern void __attn(void);
 #define ATTN() __attn();
Index: 2007-03-19/xen/include/xen/lib.h
===================================================================
--- 2007-03-19.orig/xen/include/xen/lib.h       2007-02-23 09:42:39.000000000 
+0100
+++ 2007-03-19/xen/include/xen/lib.h    2007-03-19 13:17:55.000000000 +0100
@@ -13,6 +13,15 @@ void __bug(char *file, int line) __attri
 
 #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 )
 
+#ifndef WARN
+#define WARN() do {                                             \
+    printk("Badness at %s:%d\n", __FILE__, __LINE__);           \
+    dump_execution_state();                                     \
+} while (0)
+#endif
+
+#define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
+
 /* Force a compilation error if condition is true */
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)]))
 



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] add generic WARN_ON(), Jan Beulich <=