|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] [Mini-OS] use ASSERT for BUG_ON
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 <=
|
|
|
|
|