Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / arch-generic / bug.h
diff --git a/kitten/include/arch-generic/bug.h b/kitten/include/arch-generic/bug.h
new file mode 100644 (file)
index 0000000..dcb10a2
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _ARCH_GENERIC_BUG_H
+#define _ARCH_GENERIC_BUG_H
+
+#include <lwk/compiler.h>
+
+#ifndef HAVE_ARCH_BUG
+#define BUG() do { \
+       printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
+       panic("BUG!"); \
+} while (0)
+#endif
+
+#ifndef HAVE_ARCH_BUG_ON
+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+#endif
+
+#ifndef HAVE_ARCH_ASSERT
+#define ASSERT(condition) do { if (unlikely((condition)!=1)) BUG(); } while(0)
+#endif
+
+#ifndef HAVE_ARCH_WARN_ON
+#define WARN_ON(condition) do { \
+       if (unlikely((condition)!=0)) { \
+               printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \
+               /* TODO FIX ME */ \
+               /* dump_stack(); */ \
+       } \
+} while (0)
+#endif
+
+#endif