From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] [Mini-OS] use ASSERT for BUG_ON Date: Thu, 17 Jan 2008 13:46:02 +0000 Message-ID: <20080117134602.GD11129@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org use ASSERT for BUG_ON Signed-off-by: Samuel Thibault # HG changeset patch # User Samuel Thibault # 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 #include - -/* 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 #include #include - -#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); \