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] [Mini-OS] use ASSERT for BUG_ON

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] [Mini-OS] use ASSERT for BUG_ON
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Thu, 17 Jan 2008 13:46:02 +0000
Delivery-date: Thu, 17 Jan 2008 05:47:14 -0800
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>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
use ASSERT for BUG_ON

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

# HG changeset patch
# User Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
# Date 1200577496 0
# Node ID 4d261c3c7c20430433da2d59f3037f34f3598046
# Parent  a7922b798098383d87bd62a4cc27595cfaad8dbe
use ASSERT for BUG_ON

diff -r a7922b798098 -r 4d261c3c7c20 extras/mini-os/console/xencons_ring.c
--- a/extras/mini-os/console/xencons_ring.c     Thu Jan 17 13:38:47 2008 +0000
+++ b/extras/mini-os/console/xencons_ring.c     Thu Jan 17 13:44:56 2008 +0000
@@ -8,9 +8,6 @@
 #include <xenbus.h>
 #include <xen/io/console.h>
 
-
-/* TODO - need to define BUG_ON for whole mini-os, need crash-dump as well */
-#define BUG_ON(_cond)   do{if(_cond) do_exit();} while(0);
 
 static inline struct xencons_interface *xencons_interface(void)
 {
diff -r a7922b798098 -r 4d261c3c7c20 extras/mini-os/include/lib.h
--- a/extras/mini-os/include/lib.h      Thu Jan 17 13:38:47 2008 +0000
+++ b/extras/mini-os/include/lib.h      Thu Jan 17 13:44:56 2008 +0000
@@ -111,6 +111,8 @@ do {                                    
        }                                                          \
 } while(0)
 
+#define BUG_ON(x) ASSERT(!(x))
+
 /* Consistency check as much as possible. */
 void sanity_check(void);
 
diff -r a7922b798098 -r 4d261c3c7c20 extras/mini-os/xenbus/xenbus.c
--- a/extras/mini-os/xenbus/xenbus.c    Thu Jan 17 13:38:47 2008 +0000
+++ b/extras/mini-os/xenbus/xenbus.c    Thu Jan 17 13:44:56 2008 +0000
@@ -27,10 +27,6 @@
 #include <xen/io/xs_wire.h>
 #include <spinlock.h>
 #include <xmalloc.h>
-
-#define BUG_ON(x) do { \
-    if (x) {printk("BUG at %s:%d\n", __FILE__, __LINE__); BUG(); } \
-} while (0)
 
 #define min(x,y) ({                       \
         typeof(x) tmpx = (x);                 \

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [Mini-OS] use ASSERT for BUG_ON, Samuel Thibault <=