Module: xenomai-forge
Branch: next
Commit: d97952323155decf0174e501c1fd7d30ff0909b2
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d97952323155decf0174e501c1fd7d30ff0909b2

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Dec 19 15:36:49 2013 +0100

cobalt/assert: introduce XENO_WARNON, XENO_BUG

---

 include/cobalt/kernel/assert.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/cobalt/kernel/assert.h b/include/cobalt/kernel/assert.h
index 158d51f..63886a1 100644
--- a/include/cobalt/kernel/assert.h
+++ b/include/cobalt/kernel/assert.h
@@ -43,6 +43,15 @@
                                    __FILE__, __LINE__, (#__cond));     \
        } while (0)
 
+#define XENO_BUG(__subsys)  XENO_BUGON(__subsys, 1)
+
+#define XENO_WARNON(__subsys, __cond)                                  \
+       do {                                                            \
+               if (unlikely(XENO_DEBUG(__subsys) && (__cond)))         \
+                       printk(XENO_WARN "assertion failed at %s:%d (%s)", \
+                                   __FILE__, __LINE__, (#__cond));     \
+       } while (0)
+
 #ifndef CONFIG_XENO_OPT_DEBUG_NUCLEUS
 #define CONFIG_XENO_OPT_DEBUG_NUCLEUS 0
 #endif


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to